views:

67

answers:

1

I have a SSRS field called dates. I calculated the difference between the last and beginning date using the following code:

=Code.MinutesToHoursMinutes(DateDiff("n",FIRST(Fields!Date.Value), LAST(Fields!Date.Value, "grp_Order")))

The Code.MinutesToHoursMinutes is jsut a function that makes it Hours Minutes format.

How do I now average all of these?????

A: 

Average on what, given you are already using FIRST and LAST? And why only a scope for LAST too please?

Anyway, the average is on DateDiff("n",FIRST(Fields!Date.Value), LAST(Fields!Date.Value, "grp_Order")) or other expression rather then the Code.MinutesToHoursMinutes function, no?

So in the average text box:

=Code.MinutesToHoursMinutes(Avg(`DateDiff("n",FIRST(Fields!Date.Value), LAST(Fields!Date.Value, "grp_Order"))

... or something similar.

gbn
Sorry I didn't explain htis good. That DateDiff is in a group. So the group is by Order. So this is taking the beginning and ending date of an order and seeing how long it took. What I need now is to take all the times it took for those orders and AVG them to see how long an order genrally takes.