LAST_DAY returns the date of the last day of the month. Any function for the first day of the month? Thanks!
Printable View
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.
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.
Thank you.