Jump to content

select based on a date 35 days in the future


jeff5656

Recommended Posts

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.