DAYS_OF_PREVMONTH
SELECT Trunc(SYSDATE, 'MM') firstdaythismonth,
Last_day(Trunc(SYSDATE)) lastdaythismonth,
Trunc(Trunc(SYSDATE, 'MM') - 1, 'MM') firstdayprevmonth,
Last_day(Trunc(Trunc(SYSDATE, 'MM') - 1, 'MM')) lastdayprevmonth,
Extract(DAY FROM Last_day(Trunc(Trunc(SYSDATE, 'MM') - 1, 'MM')))
days_of_prevmonth
FROM dual;
No comments:
Post a Comment