Created
October 12, 2018 14:53
-
-
Save tjmichael81/9ca75618778a0c3df9eb9849cddaa64e to your computer and use it in GitHub Desktop.
SQL Date Selections
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 date and time stamp for today/now: **/ | |
SELECT GETDATE() | |
/** Get today's date: **/ | |
SELECT CONVERT(date, GETDATE()) | |
/** Select records with today's date **/ | |
/** Example below using an Esri versioned view **/ | |
SELECT [OBJECTID] | |
,[DYETESTNUMBER] | |
,[SCHEDULEDDATE] | |
,[SCHEDULEDTIME] | |
,[TESTSTARTTIME] | |
,[Shape] | |
FROM [DyeTest].[dbo].DyeTest_evw | |
WHERE SCHEDULEDDATE LIKE CONCAT(CONVERT(date, GETDATE()), '%') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment