If your data is stored in the following format 2004-04-16 00:00:00 you can do WHERE queue_time = CURRENT_DATE() + 0 You will also be able to take advantage of an index. .... Else, if you data is kept in the datetime format, 2004-04-16 15:53:27 one option is to do WHERE DATE_FORMAT(queue_time, '%Y%m%d') = CURRENT_DATE() + 0 ...no index usage though
-----Original Message----- From: Dirk Bremer (NISC) To: [EMAIL PROTECTED] Sent: 4/16/04 3:25 PM Subject: Re: SQL Query Question ----- Original Message ----- From: "Victor Pendleton" <[EMAIL PROTECTED]> To: "'Dirk Bremer (NISC) '" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, April 16, 2004 15:06 Subject: RE: SQL Query Question > WHERE queue_time = Now() + 0 > Are you wanting just the date or the datetime? > > -----Original Message----- > From: Dirk Bremer (NISC) > To: [EMAIL PROTECTED] > Sent: 4/16/04 2:54 PM > Subject: SQL Query Question > > I have a simple table where one of the columns is named queue_time and > is > defined as a timestamp-type. I would like to query this table for all > rows > where the queue_time equals the current date. I an a newbie and have > been > wrestling with the docs for a solution. You help will be appreciated. > > Dirk Bremer - Systems Programmer II - ESS/AMS - NISC St. Peters > USA Central Time Zone > 636-922-9158 ext. 8652 fax 636-447-4471 > > [EMAIL PROTECTED] > www.nisc.cc Victor, I just want to match the date, not the time, i.e. all of the rows for the current date regardless of the time they were entered. Thanks! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]