Ed,
Wednesday, May 29, 2002, 2:24:40 AM, you wrote:

EL> I'm not sure how to phrase this. Please excuse the crudeness of my description.

EL> I'm storing calendar data in a MySQL database and I'm wondering, is there a 
EL> way to specify a day, such as the 28th, and "fourth" "Tuesday" as search 
EL> criteria when selecting rows from a table with a field of type date?

EL> Or...

EL> Another approach, is there a way to tell what week and day a given date 
EL> falls on? For example, is there a way to find out that today, the 28th, is 
EL> the 4th Tuesday and select all rows that meet this criteria?

Take a look at date and time functions:
     http://www.mysql.com/doc/D/a/Date_and_time_functions.html

It may help you.
F.e. if you want to retrieve rows where day is 'Tuesday' you can do:
     SELECT * FROM table_name WHERE DAYNAME(mydate)='Tuesday';




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to