Cakephp2 column comparison in where clause

32 views Asked by At

I have to fetch data from attendances table where status=1 and printed < allowed_prints

i tried few things,current code is given below but not working

$attendances = $this->Attendance->find('all',array(
    'conditions'=>array(
                'Attendance.status'=>1,
                'Attendance.printed < Attendance.allowed_prints'
                )
));

above query returns the following error

Attendance does not have column Attendance.printed < Attendance.allowed_prints

0

There are 0 answers