List:General Discussion« Previous MessageNext Message »
From:Robert L Ramsey Date:November 3 2009 7:33pm
Subject:getting repeating events between two dates
View as plain text  
Hi,

I have a table of events like this:

Evtuid
Evtname
Startdate
Stopdate
Repeats enum('true', 'false')
Monday enum('true', 'false')
Tuesday enum('true', 'false')
Wednesday enum('true', 'false')
Thursday enum('true', 'false')
Friday enum('true', 'false')
Satday enum('true', 'false')
Sunday enum('true', 'false')

An event might start on Monday Nov. 2 and occur on every Monday and Thursday until
November 26th.  In which case startdate would equal 2009-11-02, stopdate would equal
2009-11-26, repeats = 'true', Monday='true', and Thursday='true'.  The other days are
false.  Assume that the Evtuid=1 and Evtname='Test Event'.

Is there a query I can run that will give me a listing of every date with an event like
this:

2009-11-02  Test Event  1
2009-11-05  Test Event  1
2009-11-09  Test Event  1
2009-11-12  Test Event  1
2009-11-16  Test Event  1
2009-11-19  Test Event  1
2009-11-23  Test Event  1
2009-11-26  Test Event  1

And of course any other dates with other events that either repeat or not.

Is there a way to do that or am I better off just using php and looping through every day
in the range?

Thanks!

Bob








Thread
getting repeating events between two datesRobert L Ramsey3 Nov
  • socket '/tmp/mysql.sock' (2)Charles Brown3 Nov
RE: socket '/tmp/mysql.sock' (2)Charles Brown4 Nov
  • Re: RE: socket '/tmp/mysql.sock' (2)Claudio Nanni4 Nov
Re: socket '/tmp/mysql.sock' (2)Claudio Nanni5 Nov