Shoot....typo...going to repost it On Nov 4, 9:19 pm, Erol Fornoles <[email protected]> wrote: > On Fri, Nov 5, 2010 at 8:25 AM, bertly_the_coder <[email protected]> wrote: > > I have a dataset, which contains a day column that I would like to > > retrieve results on. Is there any reason why daily_stats.where('day = > > Date(?)', dte).first returns and empty set, > > daily_stats.find(:first, :conditions => ['date(day) = ?', dte]) > > returns the correct data and daily_stats.where({:created_at => > > (date.midnight - 1.day)..date.midnight}).first returns the wrong > > data(returns data the for the day before)? > > Aren't the queries you posted totally different ones? "WHERE DATE(:dte) = > day" is different from "DATE(day) = :dte" > > -- > Erol M. > Fornoleshttp://github.com/Erolhttp://twitter.com/erolfornoleshttp://ph.linkedin.com/in/erolfornoles
-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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/rubyonrails-talk?hl=en.

