Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help on Dates
Hi :)
Well here is a function that will return the fourth sunday of the current month. You can modify it to your particular requirement.
Just copy and paste the code between the lines and u are all set to go.
Hope this helped u out.
create or replace function fourth_sunday
return date is
tmpmth date;
begin
tmpmth := next_day(last_day(add_months(sysdate,-1)),'SUNDAY')+21;
return tmpmth;
end;
In article <gSKA1.144$YI.2041784_at_news1.i1.net>,
"Steve Wood" <sewood_at_inair.com> wrote:
> I need to perform a function beginning say the fourth Sunday of May every
> year. How can I in sql calculate that date in a procedure or trigger. Let's
> say I want to check to see if it is that do then perform the calculation
> else do something else. What sql can I use to find the 4th sunday of may?
> thanks in advance
> Steve
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Sat Aug 15 1998 - 13:31:15 CDT
![]() |
![]() |