Re: Correct date query syntax

2004-08-26 Thread SGreen
I believe you are not letting MySQL do enough work for you. The date format is perfect, even as a string, to perform the comparison you are trying to perform. SELECT @currTime := NOW(); +-+ | @currTime := NOW() | +-+ | 2004-08-26 12:48:16 | +

Re: Correct date query syntax

2004-08-26 Thread Jochem van Dieten
On Thu, 26 Aug 2004 11:31:46 -0500, Yong Wang <[EMAIL PROTECTED]> wrote: > > I have a database which contains date attribute in string format > (like 2004-08-12). I want to genearte a report based on period time. > I use the syntax: > date1 ='2004-08-12' > date2='2004-08-18' > SELECT * FROM ac

Correct date query syntax

2004-08-26 Thread Yong Wang
Hi, All: I have a database which contains date attribute in string format (like 2004-08-12). I want to genearte a report based on period time. I use the syntax: date1 ='2004-08-12' date2='2004-08-18' SELECT * FROM account WHERE (TO_DAYS(date) >= TODAYS(date1)) and (TO_DAYS(date) <= TO_DAYS(date