i have a cur_date fileld and another one expire_date (2 months later).
Whaty is the correct sql statement in order to receive rows between these two dates?
any help?
select * from table where (date <= dateadd(month,2,$cur_date) and date > $cur_date)
i put this
SELECT * FROM post WHERE now() BETWEEN date_posted AND expire_date
Is it correct?
well does it work? if it does, then i would think it is.
Mine was slightly different cos I caught the wrong end of the stick - it took the date and then worked out what date was two months ahead, and searched between those.