Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
06-17-2013, 11:45 AM #1
- Join Date
- Jun 2013
- Thanked 0 Times in 0 Posts
Last date of quarter (oracle sql)
The following gets the first date of the current quarter:
is there a way to get the last day?
Last edited by vinyl-junkie; 06-17-2013 at 01:29 PM. Reason: signatures only allowed through the control panel
06-20-2013, 12:56 AM #2
I don't use Oracle, but could you do something like[code]
TRUNC( 100 + TRUNC(sysdate,'Q'), 'Q') - 1
That is: Get the first date of the current quarter.
Add 100 days to that (no quarter is longer than 100 days) to get *ANY* date in the next quarter.
Get the first date of the next quarter.
Subtract one day from that to get the last day of the current quarter.
You may have to use functions to add and subtract days in Oracle, but the concept should work.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.