LeonelSanchezJr
Programmer
I need to create a Date Range using the SYSDATE function for the previous month.
What is the syntax?
Thanks,
Leo ;-)
What is the syntax?
Thanks,
Leo ;-)
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
select ADD_MONTHS(TRUNC(SYSDATE,'MONTH'),-1) + dt
from (select level dt from dual connect by level < 32)
Where ADD_MONTHS(TRUNC(SYSDATE,'MONTH'),-1) + dt < TRUNC(SYSDATE,'MONTH')
select ADD_MONTHS(TRUNC(SYSDATE,'MM'),-1) + dt - 1
from (select level dt from dual connect by level < 32)
Where ADD_MONTHS(TRUNC(SYSDATE,'MM'),-1) + dt - 1 < TRUNC(SYSDATE,'MM')
/