Last active
April 22, 2016 20:59
-
-
Save jmreynolds/1c490b8f1adb4d1adab265d9e711fb2d to your computer and use it in GitHub Desktop.
Gist with samples for my SSMS and LinqPad blog post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT [t1].[column] FROM [MyTable] AS [t1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATEADD(hour, datediff(hour, 0, protocolCommands.[Time_stamp]), 0) AS GroupTime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONVERT(DATETIME, | |
(CONVERT(NCHAR(4), DATEPART(Year, [t0].[Time_stamp])) + | |
('-' + (CONVERT(NCHAR(2), DATEPART(Month, [t0].[Time_stamp])) | |
+ ('-' + CONVERT(NCHAR(2), DATEPART(Day, [t0].[Time_stamp])))))) | |
+ (' ' + (CONVERT(NCHAR(2), DATEPART(Hour, [t0].[Time_stamp])) | |
+ (':' + (CONVERT(NCHAR(2), @p0) | |
+ (':' + CONVERT(NCHAR(2), @p1)))))), | |
120) AS UglyNastyMess |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment