From: dkmd_nielsen Date: 2008-11-01T02:55:11+09:00 Subject: ActiveRecord :conditions with .attributes Thanks for any help and suggestions. I'm having troubles with the following not working. It generates a "miss value for :OCRACR in OCRACR = :OCRACR..." error. slct = "OCRACR = :OCRACR and MSG = :MSG and KEYCODE = :KEYCODE and VERSION = :VERSION and DEPTH = :DEPTH " unq_rows = Entry.find_by_sql( "select distinct #{flds} from entries " ).each {|e| o = Entry.find(:all,:conditions => [slct,e.attributes]) puts o.length } When I do "pp e.attributes", it displays the following hash: {"OCRACR"=>"O", "MSG"=>"", "KEYCODE"=>"212260", "VERSION"=>"01", "DEPTH"=>"001"} Shouldn't the find :conditions be ok? The slct string appears formatted ok. The .attributes hash appears to match the :conditions string. I'm at a loss for what I am doing incorrectly. Thanks again, dvn