07-13-2017 10:30 AM
Could someone assist me how I can read only the last day of the month data from my table .
I have a sql to pull the data from netezza table to SAS Based on the period dates which has daily data But i need to pull only the data
of last day of each month. How can i accomlipsed that in the sql pass through?
30jul==> need this data
31aug ==> need this data
07-13-2017 10:46 AM - edited 07-13-2017 10:49 AM
Well, I don't know that database and its out o scope for this forum. From a SAS standpoint you can filter the recieved data in a datastep after the sql, or you can go and investigate the database's functions and guidance and build a working SQL clause there.
Edit: logically the process is to group the data by month(date) and output when date=max(date) by month. So first step would be to get month, maybe:
07-13-2017 10:54 AM
there is last_day function in neteezza, which you can derive last day and then in your where clause you can say where last day = your day