MySQL Forums
Forum List  »  PHP

Re: Temporal query with potential sub-query question.
Posted by: Web Poser
Date: July 27, 2005 09:26AM

Name: Meeting with the Bob's //Title of the meeting
event_date: 2005-06-28 //Started last month
event_end: 2006-07-28 // a one year standing meeting
recurring: 1
recurringDay: 3 // this is every Tuesday (3rd day)

Here's another meeting for next week:
Name: Dentist Appointment
event_date: 2005-08-05
event_end: 2006-08-05 // a meeting beginning and ending same day
recurring: 0 // a non recurring meeting
recurringDay: 0

The output needs to show "The Meeting with the Bob's" every Tuesday with the respective Tuesday's date (example - next tuesday show: 2005-08-02). It will also need to display the "Dentist Appointment".

example output:

2005-08-02: Meeting with the Bobs
2005-08-05: Dentist Appointment

I'm close with this last attempt of a query, hopefully you can see my logic in this:
SELECT name, event_date, recurring, event_end FROM events WHERE IF(recurring='1', event_end >= NOW() AND event_date = DATE_ADD('date', INTERVAL 7 DAY), event_date >=NOW())"

Options: ReplyQuote

Written By
Re: Temporal query with potential sub-query question.
July 27, 2005 09:26AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.