LAST_DAY returns the date of the last day of the month. Any function for the first day of the month? Thanks!
trunc(my_date,'MM') Have a browse of the SQL Reference manual.
David Aldridge, "The Oracle Sponge" Senior Manager, Business Intelligence Development XM Satellite Radio Washington, DC Oracle ACE
what is last day + 1??? LOL
Code: SQL> select sysdate from dual; SYSDATE ========= 02-MAY-03 1 row selected. SQL> select last_day(sysdate)+1 from dual; LAST_DAY( ========= 01-JUN-03 1 row selected. SQL> select last_day(trunc(sysdate,'MM')-1)+1 from dual; LAST_DAY( ========= 01-MAY-03 1 row selected.
SQL> select sysdate from dual; SYSDATE ========= 02-MAY-03 1 row selected. SQL> select last_day(sysdate)+1 from dual; LAST_DAY( ========= 01-JUN-03 1 row selected. SQL> select last_day(trunc(sysdate,'MM')-1)+1 from dual; LAST_DAY( ========= 01-MAY-03 1 row selected.
Sanjay G. Oracle Certified Professional 8i, 9i. "The degree of normality in a database is inversely proportional to that of its DBA"
Thank you.
Forum Rules