At 11:48 +0200 1/20/03, Putte Koivisto wrote:
I use MYSQL TO_DAYS function to grab some statistics from database and I use
next
statement:

SELECT ID FROM database
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) >=7
ORDER BY ID DESC

I have IIS server and I use Dreamweaver MX to build the statistics page,
where we use ASP. Problem is, that I get row from every month with date
difference of 7 instead of rows from last seven days. What went wrong? Do I
have to specify the date format someway to the TO_DAYS function?
If you want just records for the last 7 days, do you want the
difference to be < 7 rather than >= 7?

Sincerely,

Putte Koivisto

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