jeff5656 Posted February 27, 2013 Share Posted February 27, 2013 I am trying to select records where the date is 35 days from now or less (i.e less than 35 days from now includes all dates that have passed as well). However, when I do the code below, $query = "select * from institutions where exp_date < date_sub(now(), interval 35 day) order by name"; all I get are expired records. I have a record where the exp_date is 3/23/13 but it is not getting selected. Note: the exp_date is a DATE field. Quote Link to comment Share on other sites More sharing options...
Solution Barand Posted February 27, 2013 Solution Share Posted February 27, 2013 ...WHERE exp_date < CURDATE() + INTERVAL 35 DAY Quote Link to comment Share on other sites More sharing options...
jeff5656 Posted February 27, 2013 Author Share Posted February 27, 2013 Perfect. Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.