Soheil,
Wednesday, March 27, 2002, 6:45:38 PM, you wrote:

SS> I am trying to extract the data from MySQL based on the month, and day of
SS> the item, and post them on a page.
SS> Something similar to "Today in History"
SS> Here is a partial list of my table:
SS> CREATE TABLE ANNOUNCEMENT (
SS>   AnnouncementID bigint(20) unsigned DEFAULT '0' NOT NULL,
SS>   Title varchar(250),
SS>   DateShown date DEFAULT '0000-00-00' NOT NULL
SS>   KEY AnnouncementID (AnnouncementID),
SS>   KEY ID (AnnouncementID)
SS> );
SS> Can anyone please tell me what I need to do?
SS> Here is what I have so far:
SS> SELECT AnnouncementID,Title,DateShown FROM ANNOUNCEMENT WHERE
SS> DateShown=NOW() ORDER BY DateShown DESC

SS> The problem is that it matches the list to the entire date (including the
SS> year), but I only want to look at the month, and the day, when fetching the
SS> data.

Look at the date and time functions, such as DAYOFMONTH(), YEAR() and so
on:
   http://www.mysql.com/doc/D/a/Date_and_time_functions.html

SS> Thanks so much.





-- 
For technical support contracts, goto https://order.mysql.com/
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [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