How to query sql with active record for dates between specified times

后端 未结 5 1827
执念已碎
执念已碎 2020-12-16 18:25

I have a database that I want to pull only certain rows that have dates in specified ranges. I\'m not sure how to do this properly in active record. Right now it looks like

5条回答
  •  天涯浪人
    2020-12-16 18:32

    To use the "Between" by respecting the Query builder of CI:

    $this->db->where("order_datetime BETWEEN '2018-10-01' AND '2018-10-3'","", FALSE);
    

提交回复
热议问题