Need to get elapsed time between 2 datetime columns

Joined
Apr 29, 2008
Messages
12
Programming Experience
10+
I have a table that has a StartTime and EndTime column. I added a computed column that I want to reflect hours and minutes elapsed between the 2 times.

So far I have this formula which gives me the minutes:
(datediff(minute,[StartTime],[EndTime]))

Preferably the format I would like to get would be: 02:12, something that can be used in a select statement to sum up different times. The database is part of a program that keeps track of what programs you are using (monitoring active window), and adds the info to a log about the duration of each instance. I will eventually want to be able to reference the computed column to give a grand total from the log.
 
Back
Top