Fetching the last date of the current Quarter !!!
This query fetches the fist date of the current Quarter-->>select TRUNC(ADD_MONTHS(CURRENT_DATE,-1),'Q').
Need to know the last date of the current Quarter.. Tried of getting like select ADD_MONTHS(DATE,+1) but here i dont know to proceed with the quarter..
Kndly help me with this...
Your first calculation doesn't return the current quarter correctly, e.g. in July it will return 2016-04-01 instead of 2016-07-01.
-- begin of current quarter
-- end of current quarter
trunc(add_months(current_date,3), 'q') -1
oAdd_months(trunc(current_date, 'q')-1, 3)
Yeah its working for the end of current quarter. Thank you. The code for fetching the current quarter's first date is working fine. If i am wrong please correct me further..
If you consider this correct:
SELECT TRUNC(ADD_MONTHS(DATE '2016-10-20',-1),'Q');
*** Query completed. One row found. One column returned.
*** Total elapsed time was 1 second.