Page 1 of 1

SUM - from time inside a tab

Posted: Mon Jan 29, 2018 11:08 am
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.

Re: SUM - from time inside a tab

Posted: Tue Jan 30, 2018 6:33 am
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

Re: SUM - from time inside a tab

Posted: Tue Jan 30, 2018 6:37 pm
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.

Re: SUM - from time inside a tab

Posted: Wed Jan 31, 2018 6:37 am
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