record count

I have in controller

@search_sd_ticket_result = ServiceDeskTicket.find_where(:all ) do |sd|
                                     sd.number.downcase =~
"%"+@sd_ticket_number.downcase+"%" if !@sd_ticket_number==nil
                                     sd.service_desk_status_id==
@sd_ticket_status_id
                                     sd.service_desk_priority_id==
@sd_ticket_priority_id
                                     sd.primary_assignee==
@sd_ticket_primary_assignee
                                     sd.created_on <=>
(@sd_ticket_start_date..@sd_ticket_end_date) if
!@sd_ticket_start_date==nil and !@sd_ticket_end_date==nil
                                 end

NOW HOW TO GET THE COUNT OF RECORDS ONLY NOT THE COMPLETE DATA USING
ABOVE

Please help
Sijo

Your code is confusing and I dont know what records you want count in
the meaning of "THE COUNT OF RECORDS ONLY NOT THE COMPLETE DATA USING
ABOVE"

NOW HOW TO GET THE COUNT OF RECORDS ONLY NOT THE COMPLETE DATA USING
ABOVE

~R.A~

Hi
@search_sd_ticket_result = ServiceDeskTicket.find_where(:all ) do |sd|

         sd.service_desk_status_id==@sd_ticket_status_id
         sd.service_desk_priority_id==@sd_ticket_priority_id

                                 end

THIS IS WORKING HERE IN @search_sd_ticket_result I GET THE RECORDS
MATCHING.BUT WHAT I NEED IS NOT TO FETCH RECORDS BUT ONLY GET THE COUNT
OF RECORDS ..SO HOW CAN I ALTERATE THE ABOVE CODE TO GET THE COUNT OF
RECORDS

Sijo