I'm having a problem comparing dates in a database to a week from now using activerecord. I'm trying to return a list of events with their start date less than a week from now.
The event_start_date is in the format of 2011-06-30 09:00:00
$this->db->select('event_id,title,event_start_date,location'); $this->db->where('event_start_date <=',DATE_ADD(NOW(),INTERVAL 7 DAYS )); $query = $this->db->get('sd_events');