AVG - time (based on group band condition)

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

AVG - time (based on group band condition)

Post by brjohnsmith » Fri Dec 25, 2020 11:07 pm

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: 3436
Joined: Tue Mar 20, 2018 5:34 am

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

Post by Lech Kulikowski » Mon Dec 28, 2020 1:51 pm

Hello,

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

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

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

Post by brjohnsmith » Mon Dec 28, 2020 4:45 pm

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

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

Post by Andrew » Tue Dec 29, 2020 5:12 am

You are welcome!
Post Reply