I have a table in my database the records start and stop times for a specific task. Here is a sample of the data:
Start Stop
9/15/2008 5:59:46 PM 9/15/2008 6:26:28 PM
9/15/2008 6:30:45 PM 9/15/2008 6:40:49 PM
9/16/2008 8:30:45 PM 9/15/2008 9:20:29 PM
9/16/2008 12:30:45 PM 12/31/9999 12:00:00 AM
I would like to write a script that totals up the elapsed minutes for these time frames, and wherever there is a 12/31/9999 date, I want it to use the current date and time, as this is still in progress.
How would I do this using Transact-SQL?