def add_state_field user = current_user.id @states = State.find(:all, :order => "name") @user_state_counts = Canlocation.count_by_sql("select count(state_id)from canlocations where" + " user_id = ''user'' ") render(:partial => ''statefield'') end @user_state_counts is coming up with 0 so it''s not working for some reason ? I believe the statement is correct but from the results it''s not - state_id is the column I want to count so from AWDWR it shows count(*) assuming the asterik is all , then I''ve put in state_id Anyone ? Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---