SUM - from time inside a tab

Jump to: Board indexAll-in-OneStimulsoft Reports.Ultimate

Stimulsoft Reports.Ultimate discussion

SUM - from time inside a tab

Post Mon Jan 29, 2018 11:08 am

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.
brjohnsmith
 
Posts: 5
Joined: Mon Jan 29, 2018 11:04 am

Re: SUM - from time inside a tab

Post Tue Jan 30, 2018 6:33 am

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
Edward
 
Posts: 2888
Joined: Fri Jun 09, 2006 4:02 am

Re: SUM - from time inside a tab

Post Tue Jan 30, 2018 6:37 pm

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.
brjohnsmith
 
Posts: 5
Joined: Mon Jan 29, 2018 11:04 am

Re: SUM - from time inside a tab

Post Wed Jan 31, 2018 6:37 am

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
Edward
 
Posts: 2888
Joined: Fri Jun 09, 2006 4:02 am


Return to Stimulsoft Reports.Ultimate

Who is online

Users browsing this forum: No registered users and 1 guest