Actually you messed quotes:

'conditions' => array(
    "Bar.created >= NOW() - INTERVAL 7 DAY"
)

(valid for MySQL, don't know about others)

On Aug 19, 3:34 pm, "rich...@home" <[email protected]> wrote:
> or...
>
> 'conditions'=>array(
>     "Bar.created' >= (NOW() - interval '7 days')"
> )
>
> On Aug 19, 6:23 am, Elmo <[email protected]> wrote:
>
>
>
> > I would like to use the built in database date/time functions as part
> > of a 'conditions'. How is this done?
>
> > i.e.: select foo from bar where created >= (NOW() - interval '7
> > days');
>
> > I tried: 'conditions'=>array('Bar.created' => ">= (NOW() - interval '7
> > days')") to no avail.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to