> select * from articles where date(created_at) = '2009-02-06'
>
> select * from articles where date(created_at + interval '10 hours') =
> '2009-02-06'
>   

Both these queries will suck if you have loads of articles, as the 
function use of +date+ will prohibit the use of an index on created_at.

Use the BETWEEN ... AND ... syntax instead, using beginning and end of 
day of local time converted to utc.



Cheers,
Lawrence

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" 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/rails-oceania?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to