ActiveRecord and SQL SUBSTR

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?

I figured it out

History.find(:all, :conditions => ["SUBSTR(ICN, 3, 5) = ?", "07232"])

Reacher wrote: