In my project
`
$cid = $this->Surgical->find('first',array('conditions' =>
array('to_char(dt_surgery , \'DD-MM-YYYY\' )' =>'to_char(now() ,\'DD-MM-YYYY\')')));
In debug mode the query equals the following:=
SELECT “Surgical”.”id” FROM “surgicals” AS “Surgical” WHERE to_char(dt_surgery , ‘DD-MM-YYYY’ ) = ‘to_char(now() ,”DD-MM-YYYY”)’ LIMIT 1
My problem is unwanted quotes at ‘to_char(now() ,”DD-MM-YYYY”)’ i.e at begin and at end. Also there is double quotes at ”DD-MM-YYYY”
My db is Postgres and cake version is 1.3.
Actually I want the following ‘where’ condition inside the select query
WHERE to_char(dt_surgery , 'DD-MM-YYYY' ) = to_char(now() ,'DD-MM-YYYY') LIMIT 1
Did you try this? Notice line 3 does not have
' => 'but just=