At 15:41 -0400 10/1/02, Chuck Payne wrote:
>Hi,
>
>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