Created
October 10, 2017 18:10
-
-
Save tdmitch/35b7c1d578a4f7e183d07959d6f18adc to your computer and use it in GitHub Desktop.
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
/* Get local time */ | |
DECLARE @dt2 DATETIMEOFFSET = GETDATE() AT TIME ZONE 'Central Standard Time' | |
/* Convert to UTC */ | |
SET @dt2 = @dt2 AT TIME ZONE 'UTC'; | |
/* Now query the table using the offset datetime2 */ | |
SELECT ValidFrom, ValidTo, * FROM dbo.Customers | |
FOR SYSTEM_TIME AS OF @dt2 | |
WHERE (address = '' OR customerid = 13) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment