List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:January 20 2003 6:36pm
Subject:Re: What is wrong in this time difference query?
View as plain text  
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

Thread
What is wrong in this time difference query?Putte Koivisto20 Jan
  • Re: What is wrong in this time difference query?Paul DuBois20 Jan