Hi All,
Newb question...
Im having problems with a "find" command which searches all records
whose date fields match the range between $date and $end_date as
follows:
return $this-
>find('all',array('conditions'=>array('DATE(Post.date)'=>'>'.
$date,'DATE(Post.date)'=>'<'.$end_date)));
The strange thing is that the query produced uses a where clause that
is incorrect - using an = and placing the less than into the date
string:
SELECT `Post`.`id`, `Post`.`name`, `Post`.`date`, `Post`.`content`,
`Post`.`user_id`, `User`.`id`, `User`.`name`, `User`.`email`,
`User`.`firstname`, `User`.`lastname` FROM `posts` AS `Post` LEFT JOIN
`users` AS `User` ON (`Post`.`user_id` = `User`.`id`) WHERE
DATE(`Post`.`date`) = '<2008-12-31 23:59:59'
Any idea where my error is?
Best regards, Ben.
--~--~---------~--~----~------------~-------~--~----~
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]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---