I figured it out
History.find(:all, :conditions => ["SUBSTR(ICN, 3, 5) = ?",
"07232"])
Reacher wrote:> In one of my tables, I have a column that holds a 13 digit number that
> comprises several pieces of information. digits 2-6 contain a date (2
> digits for year without century, and 3 digits for julian date). Using
> straight SQL, I can select based on todays date using this query:
>
> SELET * from t_history where SUBSTR(ICN, 3, 5) = ''07232'';
>
> How can I translate this SUBSTR calculation into ActiveRecord''s
find
> condition hash?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---