Re: Database Date/Time Functions?
or... 'conditions'=array( Bar.created' = (NOW() - interval '7 days') ) On Aug 19, 6:23 am, Elmo emre...@gmail.com 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Database Date/Time Functions?
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 richardath...@gmail.com wrote: or... 'conditions'=array( Bar.created' = (NOW() - interval '7 days') ) On Aug 19, 6:23 am, Elmo emre...@gmail.com 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Database Date/Time Functions?
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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---