将Start_date与SQL中的当前日期进行比较

I need to compare start_date to current_date so that i could found the data of the particular day(In other words: data of the day). For this, i am using this query

    $rs = $this->db->select('ult_camp.*')
                    ->order_by('ult_camp.start_date', 'desc')
                    ->from('ult_camp')
                    ->where('ult_camp.status', 'Active')
                    ->where('date(ult_camp.start_date)<=', date('Y-m-d h:m:s'))
                    ->get()->result();
    return $rs;

But this query i'm getting the data whose start_date is less than the current date.Please Help me to get this.

Any help will be appreciated. Thanks in advance.

You can add another where to get the date range for the day starting 12:00:00 until the present time.

 $rs = $this->db->select('ult_camp.*')
                ->order_by('ult_camp.start_date', 'desc')
                ->from('ult_camp')
                ->where('ult_camp.status', 'Active')
                ->where('date(ult_camp.start_date)<=', date('Y-m-d h:i:s'))
                ->where('date(ult_camp.start_date)>=', date('Y-m-d 00:00:00'))
                ->get()->result();
return $rs;

This where clause should translate to:

date(ult_camp.start_date) <= '2017-09-02 08:55:20' AND date(ult_camp.start_date) >= '2017-09-02 00:00:00'

Note: i -> is for minutes and m -> is for month in php date formats