AVG - time (based on group band condition)

Stimulsoft Reports.NET discussion
Post Reply
brjohnsmith
Posts: 30
Joined: Mon Jan 29, 2018 11:04 am

AVG - time (based on group band condition)

Post by brjohnsmith »

Hi,

I used the DateDiff to get the difference between two time, however, I need to get the average of this time based on the count that I have on group band. for numeric value, if I just divide the numbers by count(), I get the average, but I cannot do it with the time format. please it seems that I need to convert it before to numberic, divide to the Count function (average), and only then to convert to time again. I am not sure if it is this way, but if someone knows how to solve it, I would appreciate it a lot. thx.
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: AVG - time (based on group band condition)

Post by Lech Kulikowski »

Hello,

Please check the following expression:
{TimeSpan.FromMinutes( AvgD( DateDiff(Date1,Date2).TotalMinutes) )}

Thank you.
brjohnsmith
Posts: 30
Joined: Mon Jan 29, 2018 11:04 am

Re: AVG - time (based on group band condition)

Post by brjohnsmith »

Hi Lech, it worked, thx a lot.
Andrew
Posts: 4104
Joined: Fri Jun 09, 2006 3:58 am

Re: AVG - time (based on group band condition)

Post by Andrew »

You are welcome!
Post Reply