hello all, How do i make a query on active records that would display the list of all records that happened on this day or lets says today''s transaction records. "Datetime" is my data type of the field on the database. Any help / advice will be appreciated. Thank you -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Andrew Timberlake
2009-Feb-02 10:38 UTC
Re: Query that display the list for todays records
On Mon, Feb 2, 2009 at 10:37 AM, Johnroy World < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > hello all, > > How do i make a query on active records that would display the list of > all records that happened on this day or lets says today''s transaction > records. > > "Datetime" is my data type of the field on the database. Any help / > advice will be appreciated. > > Thank you > -- > Posted via http://www.ruby-forum.com/. > > > >Model.find(:all, :conditions => {:created_at => (Time.now.beginning_of_day..Time.now.end_of_day)}) -- Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---