2012/8/29 rockbust <rockbust@optonline.net>
If anyone can point me in the right direction.. It will be much appreciated
I am trying to return a list of User where Attendance.created is between a
date specified in my form.
Further Attendance.created needs to be equal or greater than
attendance_count input from the form.
Attendance belongsTo User
I have tried this but get sql error Unknown column 'Attendance.created'
function admin_attendance_by_date_range() {
$this->Attendance->recursive = 0;
$session_school_id = $this->Session->read('Userinfo.currentSchoolid');
$from = $this->data['Attendance']['start_date']['year'] . "-" .
$this->data['Attendance']['start_date']['month'] . "-" .
$this->data['Attendance']['start_date']['day'];
$to = $this->data['Attendance']['end_date']['year'] . "-" .
$this->data['Attendance']['end_date']['month'] . "-" .
$this->data['Attendance']['end_date']['day'];
$cond = array('Attendance.created BETWEEN ? AND ?' => array($from, $to),
'Attendance.school_id' => $session_school_id);
Robert
--
View this message in context: http://cakephp.1045679.n5.nabble.com/complex-find-tp5710758.html
Sent from the CakePHP mailing list archive at Nabble.com.
--
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
Ivan Rimac
mail: ivnrmc@gmail.com
tel: +385 95 555 99 66
--
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
No comments:
Post a Comment