MySQL Forums
Forum List  »  Newbie

Weekdays and BOOLEANs
Posted by: NeoAmsterdam
Date: August 09, 2005 02:50PM

Hi, all!

I'm having a problem involving weekdays (i.e.: Sunday, Monday, Tuesday...) for a schedule-like database. The way I currently have the table set up is as follows...

CREATE TABLE Schedules(
...
Time_Start TIME, Time_End TIME,
Date_Start DATE, Date_End DATE,
Weekday_Sunday BOOL, Weekday_Monday BOOL, ... , Weekday_Saturday BOOL
...
);

The idea was that I would be able to query and get the records that apply to any given moment, such as...

SELECT * FROM Schedules WHERE
(Time_Start <= NOW() AND NOW() < Time_End) AND (Date_Start <= NOW() AND NOW() < Date_End) ...

...but how would I say "AND where the current day of the week contains TRUE"?

Thanks in advance.

Options: ReplyQuote


Subject
Written By
Posted
Weekdays and BOOLEANs
August 09, 2005 02:50PM
August 10, 2005 02:33AM
August 10, 2005 10:55PM
August 11, 2005 01:11AM
August 11, 2005 12:28PM
August 11, 2005 01:43PM
August 11, 2005 05:13PM


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.