August 18th, 2000, 12:11 PM
Can someone help me out with this at all? I am looking to query and display results from a field that contains the current days date. I am just not sure how to write the proper query to so that the query statement knows what the current date is.
August 18th, 2000, 12:50 PM
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
WHERE date_column = SYSDATE;
This, of course, assumes that the date_column column is stored as a MySQL DATE type.
August 18th, 2000, 01:44 PM
> date_column = SYSDATE
oh, alright. How about yesterday? Is it:
date_column = SYSDATE -1
August 18th, 2000, 03:38 PM
Can someone explain the differnece between CURDATE() and SYSDATE?
Thanks for the responses so far
August 20th, 2000, 04:23 PM
SYSDATE returns a date accurate to the current second (the same as NOW). CURDATE returns a date accurate to the current day. Generally you'll want to use CURDATE when working with just dates, and SYSDATE when you want to deal with times in days -- CURDATE is handy as CURDATE - 1 is yesterday, CURDATE + 1 is tomorrow, etc., whereas with SYSDATE, SYSDATE + 1 is one second from now. Depends on application really. My first response should really have used CURDATE rather than SYSDATE. :-)