Aah, I stand corrected. Friday afternoon is not my best day to be
answering questions on here. ;)
Regards,
Mike Hillyer
www.vbmysql.com
-Original Message-
From: Keith C. Ivey [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2003 1:59 PM
To: [EMAIL PROTECTED]
Subject: RE: Help with Date
On 6 Jun 2003 at 13:43, Mike Hillyer wrote:
> SELECT StartDate FROM Events
> WHERE 0 <= TO_DAYS(NOW()) - TO_DAYS(StartDate) <= 30;
I don't think that's doing what you think it is. In math notation <=
can be chained that way, but not in most programming languages.
0 <= x <= 30
is equivalen
On 6 Jun 2003 at 20:34, Trevor Sather wrote:
> mysql> SELECT StartDate FROM Events
> -> WHERE TO_DAYS(NOW()) - TO_DAYS(StartDate) <= 30;
> ++
> | StartDate |
> ++
> | 2004122600 |
> | 2003072100 |
> | 2003080600 |
> | 2003092600 |
> | 200305
Thanks very much (to all who replied) -- this looks good!
Best wishes
-Original Message-
From: Paul DuBois [mailto:[EMAIL PROTECTED]
Sent: 06 June 2003 20:46
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Help with Date Range Query
At 20:34 +0100 6/6/03, Trevor Sather wrote
At 20:34 +0100 6/6/03, Trevor Sather wrote:
Hello,
Any idea why the following doesn't work? It's taken from the MySQL manual
which says it should return records in the last 30 days. As you can see,
I'm getting records spanning some 19 months from last May to December
2004...
The example probably
Because now - a future date is a negative number, and therefore < 30.
Trevor Sather wrote:
Hello,
Any idea why the following doesn't work? It's taken from the MySQL manual
which says it should return records in the last 30 days. As you can see,
I'm getting records spanning some 19 months from
()) - TO_DAYS(StartDate) <= 30;
Regards,
Mike Hillyer
www.vbmysql.com
-Original Message-
From: Trevor Sather [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2003 1:34 PM
To: [EMAIL PROTECTED]
Subject: Help with Date Range Query
Hello,
Any idea why the following doesn't work?
Hello,
Any idea why the following doesn't work? It's taken from the MySQL manual
which says it should return records in the last 30 days. As you can see,
I'm getting records spanning some 19 months from last May to December
2004...
mysql> SELECT StartDate FROM Events
-> WHERE TO_DAYS(NOW())