# Typecasting ActiveRecord Find Results

**URL:** <https://www.ruby-forum.com/t/typecasting-activerecord-find-results/181608>\
**Category:** Rails\
**Created:** [January 14, 2010, 3:52pm UTC](https://www.ruby-forum.com/t/typecasting-activerecord-find-results/181608 "2010-01-14T15:52:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 14, 2010, 3:52pm UTC](https://www.ruby-forum.com/t/typecasting-activerecord-find-results/181608/1 "2010-01-14T15:52:21Z")

</div>

If you run a query such as the following:

Group.find(:select =\> ‘group.name, COUNT(members) as  
member\_count’, :joins =\> :members, :group =\> ‘group’)

All of the sql calculations (e.g. member\_count) are typecast as  
strings. Is there a way to specify how the results will be typcast?

p.s. I realize there are other ways to accomplish the example, but  
this is a simplified version of the type of query I need to run taking  
advantage of the :select option for the ActiveRecord Find method.
