->where between code example
Example 1: codeigniter db where between
$minvalue = '2020-01-01 00:00:00';
$max_value = '2050-12-31 23:59:59';
$this->db->where("date_field BETWEEN '$minvalue' AND '$maxvalue'");
Example 2: sql BETWEEN
/*the BETWEEN operator is used to filter the result set within
a certain range. the values can be numbers, texts or dates */
SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 AND value2;