I’m trying to generate a report for the average number of calls a person
makes per-day. The following generates the correct list, but if a user
didn’t make any calls a certain day it doesn’t show up.
from_date = Time.now.at_beginning_of_month.to_s(:db)
to_date = Time.now.tomorrow.to_s(:db)
ave_calls = @current_user.calls.average(:num_of_calls,
:group => “DATE(calls.start_time_stamp)”,
:conditions => [“calls.created_at BETWEEN ? AND ?”,
What is the best way of doing this? An example I have right now, I have
data from August 3rd til Today, no calls were made August 2nd or August
1st. The list comes back and starts at the 3rd.