I am trying to convert hours and minutes to decimal and arrive at a sum of time taken.
can any one provide me with the code.
The column TotalTimeSpent is the diff in hours/mins between the Started and Ended times.
SELECT DATENAME(weekday, Started) AS Day,
dbo.FormatDateTime(Started, 'HH:MMS 12') as Started,
dbo.FormatDateTime(Ended, 'HH:MMS 12') as Ended,
CONVERT(varchar,TimeTaken,108) AS TotalTimeSpent
FROM dbo.Journal J
LEFT OUTER JOIN dbo.Categories C ON
J.CategoryID = C.CategoryID
--DATENAME(weekday, Started) =@Weekday
Started >= @StartDate
ORDER BY Day, Category, Started