Extract Month, Year (Netezza SQL)
My data type is a date formatted as YYYY-MON-DD I would like to extract the month and year to be formatted as MON YYYY while keeping the data type as date so that I will be able to use it with the ADD_MONTHS function. Is there a way to do so? I extract the date from the data field called date_process. This is what I thought of but it doesnt seem to be working. SELECT TO_DATE(TO_CHAR(PROCESS_DATE,'YYYY-MON'), 'MON YYYY') AS PERIOD, Thank you.
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.