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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.


Reply via email to