How to fetch data using 'between in sql'?

here is my code -
$appointments = $events->find('all')->where(['facility_id' => $this->request->data(['facilities'])]);

And I have two variable holding dates - $from_date and $to_date. In the table , there are a column name ‘date’.

Hint: is good to read the doc before posting.

Go to http://book.cakephp.org/3.0/en/orm/query-builder.html and search for between().

1 Like

Please tell me ,
dateDiff(), how it works?