Hi Erick,

> i have a date/time column. i insert into it using "now()". works fine.
> now i want a query where data/time is either today or yesterday.
> how should i do it?


Calculate the date required (yesterday and/or today) and then add a time
component of midnight (all zeroes) to make up a date-time value. Then it is
a matter of performing a WHERE calculated_time < column_value.

If you are planning on performing date arithmetic you may want to consider
moving from date-time format to UNIX format timestamps.

Regards,
=dn



---------------------------------------------------------------------
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