Welcome Guest, Not a member yet? Register   Sign In
Can I use BETWEEN in active record?

I want to convert the following to active record.

How can I do it?

$query = $this->db->query("SELECT DATE_FORMAT(eventDate,'%d')
AS day,eventContent,eventTitle,id,user,user_id
FROM eventcal
WHERE eventDate
BETWEEN  '$current_year/$current_month/01'
AND '$current_year/$current_month/$total_days_of_current_month'");

Can I use BETWEEN in the active record?

[eluser]Phil Sturgeon[/eluser]
Sadly it's only possible via:

$this->db->where("eventDate BETWEEN '$current_year/$current_month/01' AND '$current_year/$current_month/$total_days_of_current_month'", '', FALSE);

Between is not a generic SQL feature so ActiveRecord does not support it.

Thanks Phil.

Theme © iAndrew 2016 - Forum software by © MyBB