Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[b]create[/b] [b]table[/b] #temp (
field [b]varchar[/b](100)
)
[b]insert[/b] [b]into[/b] #temp [b]values[/b]
( [green][i]'2013-12-06 01:30:40'[/i][/green] ),
( [green][i]'02:00:20'[/i][/green] )
[b]select[/b]
cast(round(sum(datepart(hh, cast(field [b]as[/b] [b]time[/b])) * 60 + datepart(mi, cast(field [b]as[/b] [b]time[/b])) + datepart(ss, cast(field [b]as[/b] [b]time[/b])) / 60.0), 0) [b]as[/b] [b]int[/b])
[b]from[/b] #temp
field
-----------
211
Declare @Temp Table(Field VarChar(20))
Insert Into @Temp Values('2013-12-06 01:30:40')
Insert Into @Temp Values('02:00:20')
Insert Into @Temp Values('Fast')
Select Sum(DateDiff(Second, 0, Case When IsDate(Field) = 1 Then Convert(Time, Field) End) % 86400 / 60.0)
From @Temp
Declare @Temp Table(Field VarChar(20))
Insert Into @Temp Values('2013-12-06 01:30:40')
Insert Into @Temp Values('02:00:20')
Insert Into @Temp Values('Fast')
Select Sum(DateDiff(Second, 0, Case When IsDate(Field) = 1 Then Convert(DateTime, Field) - Convert(Int, Convert(DateTime, Field)) End) % 86400 / 60.0)
From @Temp