Ruby on Rails Tuesday, April 27, 2010

On Apr 27, 9:07 pm, Joshua Martin <josmar52...@gmail.com> wrote:
> I have a datetime field in the database. How do I find records for a
> particular date regardless of the time of day?
>
you need to search for records where that date column falls in the
appropriate range (ie midnight on that day until midnight on the
following day0

Fred
> The method I'm trying does not work.. tasks.find(:all, :conditions => ["date
> == ?", Date.today])
>
> --
> _________________________________
>
> Joshua S. Martin
>
> CONFIDENTIALITY NOTE: This e-mail message, including any attachment(s),
> contains information that may be confidential, protected by the attorney
> client or other legal privileges, and or proprietary non public information.
> If you are not an intended recipient of this message or an authorized
> assistant to an intended recipient, please notify the sender by replying to
> this message and then delete it from your system. Use, dissemination,
> distribution, or reproduction of this message and or any of its attachments
> (if any) by unintended recipients is not authorized and may be unlawful.
>
> --
> 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@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment