Sunday, 15 March 2015

tsql - Convert HH:MM:SS string to number of minutes -



tsql - Convert HH:MM:SS string to number of minutes -

i have below query.

select cast(dateadd(minute, datediff(minute, timein, timeout), 0) time(0) )

i results 2 columns in format of hrs-min-seconds. in format of min only. 02:47:00 read 167.

for sql server (works 2005 too):

select datediff(mi,convert(datetime,'00:00:00',108), convert(datetime,'02:47:00',108))

tsql

No comments:

Post a Comment