> Can someone help me with the correct sytax here !
> I'm trying to show results from the last two days(or week etc)
>
> This is what I've got as my sql query
>
> SELECT .....
> WHERE.....
> AND ( (DATE_SUB(j.stellen.t_stellen_date INTERVAL 2 day) <
> j.stellen.t_stellen_date)
>
> but it doesn't work !
>
> What's wrong ?
>
> The t_stellen_date field is a date field !

Yor clause seems to asking wherer two days before a date is less than that
data - which, of course, is always true. On the other hand, you don't seem
to
mention any reference time that you are comparing to.

How about:

SELECT .....
WHERE.....
AND ( (DATE_SUB(CURRENT_DATE INTERVAL 2 day) <
j.stellen.t_stellen_date)

     Alec Cawley

mysql



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