Link to home
Start Free TrialLog in
Avatar of joleinik
joleinik

asked on

select Multiple dates recurring weekly?

I have a table with events that occur weekly.  I would like to have a list of dates that these events occured (once a week) since a selected date.  For instance, I know that there is an event that occurs every Monday at 10:00AM.  I would like to give it a date, say October 26th, 2003. I would then like to have a list similar to this:

November 17
November 10
November 03
October 27

What is the best way to go about this?  I know that I can select items in a table that has a datestamp by using the MySQL DAYOFWEEK() function, but it doesn't seem to be applicable in this situitation due to the fact that I do not have a list of dates that I can just SELECT from.  

Any ideas?  Thanks a bunch.
Avatar of vk33
vk33

Sorry, do you have your table created or you need to design it now? If you have one, could you post the structure?
Avatar of joleinik

ASKER

Sure, no problem.  Here are the basics:

INT - EventID
INT - EventDay (day of week event occurs, 1=Monday 7=Sunday)
INT - EventTime (hour that event starts, 14 = 2PM)
INT - ShowID - key to foreign table for data about event

 
ASKER CERTIFIED SOLUTION
Avatar of vk33
vk33

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good call vk33,
    I'm implimenting this in PHP, and it doesn't seem to have a strong calendar function.  Doing this on the PHP side of things makes much more sense.  I will re-post on the PHP forum.
    Thanks again.

-John Oleinik
Always welcome! ;)