Created
May 19, 2019 22:05
-
-
Save ArCiGo/0ff3549f1cb65862e635f8368b2b0340 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
SELECT GETDATE(); | |
GO | |
/** Output **/ | |
----------------------- | |
2017-03-20 16:57:22.273 | |
SELECT DATEPART(yy, ord.OrderDate) | |
FROM [ORDER] ord; | |
GO | |
/** Output **/ | |
2014 | |
2014 | |
2014 | |
2014 | |
2014 | |
2014 | |
2014 | |
... | |
SELECT DATEADD(mm, 1, GETDATE()); | |
GO | |
/** Output **/ | |
----------------------- | |
2017-04-20 16:59:18.760 | |
SELECT MONTH('20170426'); | |
GO | |
/** Output **/ | |
----------- | |
4 | |
SELECT DAY('20170426'); | |
GO | |
/** Output **/ | |
----------- | |
26 | |
SELECT YEAR('20170426'); | |
GO | |
/** Output **/ | |
----------- | |
2017 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment