Created
September 11, 2018 13:53
-
-
Save jamespaultg/e2eb2388c1904786d2bb205eddd5ab96 to your computer and use it in GitHub Desktop.
Handy sql scripts to get dates
This file contains hidden or 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 the last date of the previous year (31-Dec-yyyy) | |
| select trunc(current_date, 'yyyy')-1 from dual; | |
| -- Get the first date of the previous year (01-Jan-yyyy) | |
| select add_months(trunc(current_date, 'yyyy'),-12) from dual; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment