SUM - from time inside a tab

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

SUM - from time inside a tab

Post by brjohnsmith »

Hi,

I have a databand with some information. one of them is time (HH:MM). and I would like to have the total of the time from this table.

I have been using {cSum(DataBandx,Hour(xxxxx))} and this way I have only the total of the hours, not included the minutes.

Does anyone know how to solve it?

Thank you.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: SUM - from time inside a tab

Post by Edward »

Hi John,

If you would like to get a sum of total minutes, then it is possible to do like that:

Code: Select all

{cSum(DataBandz,60*int.Parse(xxxxx.ToString("hh"))+int.Parse(xxxxx.ToString("mm")))}
Thank you,
Edward
brjohnsmith
Posts: 30
Joined: Mon Jan 29, 2018 11:04 am

Re: SUM - from time inside a tab

Post by brjohnsmith »

Hi Edward,

thank you, but we are almost there. the idea is not to have the sum in minutes, but in hours and minutes, for example: if I have a table with two values: 10:20 and other 09: 25, the total would be: 19:45, this would be the expecting result.

do you have other hint?

tks.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: SUM - from time inside a tab

Post by Edward »

Hi John,

No problem, please check the following approach:

Code: Select all

{Totals.cSum(DataBandx,int.Parse(xxx.ToString("hh")))} : {Totals.cSum(DataBandx,int.Parse(xxx.ToString("mm")))}
Thank you,
Edward
Post Reply