Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: utilizing dates
On Mon, 21 Jul 2003 21:26:19 -0600, "Shawn" <spedwards_at_qwest.net>
wrote:
>I have a simple script that I was given that I run the first business day of
>each quarter for the previous quarter. So, for the past year I manually
>pass it a start date and a end date for the previous quarter. So, I ran it
>on July 1st passing it 01-Apr-03 as the start date and 30-Jun-03 as the end
>date. It was suggested to me that the script could be automated to
>determine these dates itself since its always run on the first business day
>of the quarter.
>I'm just not sure where to find this functionality. Any suggestions would
>be greatly appreciated!
>
>Thanks,
>Shawn
>
try trunc(sysdate,'Q') or try add_months(trunc(sysdate,'YEAR'),<number of quarters>*3). For the end of the quarter use the same expression embedded in LAST_DAY(ADD_MONTHS(original expression,3))
Sybrand Bakker, Senior Oracle DBA
To reply remove -verwijderdit from my e-mail address Received on Mon Jul 21 2003 - 23:12:07 CDT
![]() |
![]() |