On Tue, 3 May 2005, Flavio S. Glock wrote:

How about using a "view" to create a "lazy" sql recurrence.

For example:
 "FREQ=YEARLY;BYMONTH=3,6"

--- postgresql ---
CREATE TABLE YEARS ( N DATE UNIQUE PRIMARY KEY );
insert into years values ( date('1990-01-01') );
insert into years values ( date('1991-01-01') );
insert into years values ( date('1992-01-01') );
CREATE VIEW RECURR AS
   select ( n + interval '2 month' ) from years union
   select ( n + interval '5 month' ) from years;
----

The sql statements could be generated automatically using a DateTime::Format module.

That still won't handle "1st Sunday of the month" all that easily, as that's a more complex calculation.



-dave

/*===================================================
VegGuide.Org                        www.BookIRead.com
Your guide to all that's veg.       My book blog
===================================================*/

Reply via email to