List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:October 1 2002 9:35pm
Subject:Re: How many days out...
View as plain text  
At 15:41 -0400 10/1/02, Chuck Payne wrote:
>I am having problems get how many days out an invoice is from mysql. I have
>try this.
>SELECT NOW()-summitted_date FROM table;
>But it not working as usually. So please guys a little help.

What do you mean "not working as usually"?  A query written like that
will *never* work.  That's not how you do date arithmetic in MySQL.
(That is, MySQL will calculate an answer, but it's not going to be what you
seem to expect.)

Try TO_DAYS(NOW()) - TO_DAYS(summitted_date) to get the difference between
dates in days.

>So If an invoice was summitted on 9-26-02 then I should be able to see that
>5 days.
>Chuck Payne
>Magi Design and Support
>sql, mysql

How many days out...Chuck Payne1 Oct
  • Re: How many days out...Paul DuBois2 Oct