Select Add_Months(Trunc(Sysdate,'mm'), -Mod(To_Number(To_Char(Sysdate,'mm'))+2,3)) quarter_start,
add_months(trunc(sysdate,'mm'), mod(to_number(to_char(sysdate,'mm'))+2,3))-1/86400 quarter_end
from dual;
Results:
QUARTER_START QUARTER_END
------------------------- -------------------------
01-JUL-2012 00:00:00 31-OCT-2012 23:59:59
Give this a try:
ReplyDeleteselect trunc(sysdate, 'q') quarter_start
, add_months(trunc(sysdate, 'q'),3) - 1 quarter_end
from dual;