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.
[COLOR=blue]DECLARE[/color] @Test [COLOR=#FF00FF]datetime[/color]
[COLOR=blue]SET[/color] @Test = [COLOR=red]'20061112'[/color]
[COLOR=blue]SELECT[/color] [COLOR=#FF00FF]DateDiff[/color](ss, @test, [COLOR=#FF00FF]GETDATE[/color]()) [COLOR=blue]AS[/color] DTDiff
[COLOR=blue]SELECT[/color] [COLOR=#FF00FF]CAST[/color]([COLOR=#FF00FF]CAST[/color](Tbl1.DTDiff/3600 [COLOR=blue]as[/color] [COLOR=blue]int[/color]) [COLOR=blue]as[/color] [COLOR=blue]varchar[/color](20))+[COLOR=red]':'[/color]+
[COLOR=#FF00FF]RIGHT[/color]([COLOR=red]'00'[/color]+[COLOR=#FF00FF]CAST[/color]([COLOR=#FF00FF]CAST[/color]((Tbl1.DTDiff - [COLOR=#FF00FF]CAST[/color](Tbl1.DTDiff/3600 [COLOR=blue]as[/color] [COLOR=blue]int[/color])*3600)/60 [COLOR=blue]as[/color] [COLOR=blue]int[/color]) [COLOR=blue]as[/color] [COLOR=blue]varchar[/color](2)),2)+[COLOR=red]':'[/color]+
[COLOR=#FF00FF]RIGHT[/color]([COLOR=red]'00'[/color]+[COLOR=#FF00FF]CAST[/color](Tbl1.DTDiff%60 [COLOR=blue]as[/color] [COLOR=blue]varchar[/color](20)),2)
[COLOR=blue]FROM[/color] ([COLOR=blue]SELECT[/color] [COLOR=#FF00FF]DateDiff[/color](ss, @test, [COLOR=#FF00FF]GETDATE[/color]()) [COLOR=blue]AS[/color] DTDiff) Tbl1
[COLOR=blue]Declare[/color] @Start [COLOR=#FF00FF]DateTime[/color]
[COLOR=blue]Declare[/color] @End [COLOR=#FF00FF]DateTime[/color]
[COLOR=blue]Declare[/color] @Difference [COLOR=#FF00FF]DateTime[/color]
[COLOR=blue]Set[/color] @Start = [COLOR=red]'06/18/2007 8:00:00 AM'[/color]
[COLOR=blue]Set[/color] @End = [COLOR=red]'06/18/2007 11:41:45 AM'[/color]
[COLOR=blue]Set[/color] @Difference = @End - @Start
[COLOR=blue]Select[/color] [COLOR=#FF00FF]DATEPART[/color](hh, @Difference), [COLOR=#FF00FF]DATEPART[/color](mi, @Difference), [COLOR=#FF00FF]DATEPART[/color](ss, @Difference)
[COLOR=blue]SELECT[/color]
[COLOR=#FF00FF]DATEPART[/color](hh, datetwo - dateone),
[COLOR=#FF00FF]DATEPART[/color](mi, datetwo - dateone),
[COLOR=#FF00FF]DATEPART[/color](ss, datetwo - dateone)
[COLOR=blue]FROM[/color] TABLENAME