Forum Moderators: coopster

Message Too Old, No Replies

mysql using variable in date_add

         

helenp

10:55 am on Oct 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi
here is another one that I thought would be easy.
seems can put variable in the date_add?

this is what I want to do, to get the in the variable and rest 1 month from it:
WHERE (llegada) <= '$date'(DATE_ADD('$date(), INTERVAL -1 MONTH))

This works perfect
WHERE (llegada) <= '$date'
and this as well:
WHERE MONTH(llegada) <= MONTH(DATE_ADD(NOW(), INTERVAL -1 MONTH))

coopster

8:37 pm on Oct 29, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



WHERE llegada <= DATE_ADD('$date', INTERVAL -1 MONTH)