|
Posted by John Meyer on 12/20/05 22:38
Mara Guida wrote:
> John Meyer wrote:
>
>>Okay, I have a database listing various meetings. The meetings have a
>>day of the week and a time (Say Sunday at 8:00). Now, given a set of
>>these meetings, how would I order them so that they would go Sunday,
>>Monday, Tuesday, Wednesday, Thursday, Friday. note these meetings don't
>>have dates, just day of week and time. Oh, and they're coming from a
>>MySQL database.
>
>
>
> create table daysofweek (weekdaynumber int, weekdayname varchar(9));
> insert daysofweek values (0, 'Monday');
> insert daysofweek values (1, 'Tuesday');
> insert daysofweek values (2, 'Wednesday');
> insert daysofweek values (3, 'Thursday');
> insert daysofweek values (4, 'Friday');
> insert daysofweek values (5, 'Saturday');
> insert daysofweek values (6, 'Sunday');
>
> Now link your tables together with daysofweek and ORDER BY
> weekdaynumber.
Thanks for pointing out an obvious and simple solution.
[Back to original message]
|