Hello folks
I been wracking my brain trying to figure out how to calculate time in minutes and seconds. I have these 2 date time values
My elapsed ('Elapsed Time' = @ENDDATE - @STARTDATE) time comes back like this 1900-01-01 00:04:47.000 which is the correct value for the time 4 minutes 47 seconds. I need to get just the time value from this.
What is the best way to calculate the time between two date time fields and get just the time portion.
So for this example I need to get 4:47 and no date and no milliseconds in decimal format
Thanks in advance
RJL
I been wracking my brain trying to figure out how to calculate time in minutes and seconds. I have these 2 date time values
SQL:
DECLARE @STARTDATE DATETIME
DECLARE @ENDDATE DATETIME
SET @STARTDATE = '2/7/2013 9:51:54'
SET @ENDDATE = '2/7/2013 9:56:41'
SELECT
'Elapsed Minutes' = DATEDIFF(mi,@ENDDATE,@STARTDATE),
'Elapsed Time' = @ENDDATE - @STARTDATE,
'Start Time' = @STARTDATE,
'End Time' = @ENDDATE
My elapsed ('Elapsed Time' = @ENDDATE - @STARTDATE) time comes back like this 1900-01-01 00:04:47.000 which is the correct value for the time 4 minutes 47 seconds. I need to get just the time value from this.
What is the best way to calculate the time between two date time fields and get just the time portion.
So for this example I need to get 4:47 and no date and no milliseconds in decimal format
Thanks in advance
RJL