Monday, December 8, 2008

ORACLE First / last of Month / quarter

select
trunc(sysdate,'MM') as FIRST_OF_MONTH
from dual;

select
trunc(LAST_DAY(sysdate)) as LAST_OF_MONTH
from dual;

select
trunc(sysdate,'Q') as FIRST_OF_QUARTER
from dual;

select
add_months( trunc(sysdate,'Q'),3) - 1 as LAST_OF_QUARTER
from dual;

Till Next Time