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