I'm trying to find all Posts within a given range of dates (the month
of February 2007 in this example), and I can't figure it out.

This isn't returning any results:
$conditions['Post.created'] = array('>= 2007-02-01', '<= 2007-02-28');
$this->Post->findAll($conditions);

The strange part is that this works:
$conditions['Post.created'] = '>= 2007-02-01';
$this->Post->findAll($conditions);

And so does this:
$conditions['Post.created'] = '<= 2007-02-31';
$this->Post->findAll($conditions);

And so does this, assuming that posts exist on both those days, and it
only returns posts on those days:
$conditions['Post.created'] = array('2007-02-01', 2007-02-31');
$this->Post->findAll($conditions);

It also works if I query the database directly like this:
select * from posts where created >= '2007-02-01' && created <=
'2007-02-31';

Am I missing somthing? Why isn't this working?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to