 
     "#{result} AND #{where}"
 
-dayRangeQuery = (model, {query, fromDay, toDay, shouldStream}) ->
-  days = _.range(toDay, fromDay, -1)
+dayRangeQuery = (model, {query, days, shouldStream}) ->
   join = if shouldStream then util.streamJoin else util.forkJoin
   join _.map(days, (day) ->
     model.event.query _.defaults {

      toDay = util.dateToDay(new Date()) + 1
      fromDay = toDay - 1

    numerator = dayRangeQuery model, {
      shouldStream
      fromDay
      toDay
      query:
        select: metric.numerator.select
        from: metric.numerator.from

    views = if hasViews
      dayRangeQuery model, {
        shouldStream
        days
        query:
          select: 'count(distinct(userId))'
          from: 'view'
