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?
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.
|All times are GMT +1. The time now is 11:36 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.