Page 1 of 1

What is the best practice for sum up the time?

Posted: Tue Jun 29, 2010 4:14 am
by ssaturn
Hi,

I have a question on how to sum up a time (1 hour + 30 min + 2 hours) = 3 hours 30 min in Cross-Tabs. Any best practice available? What kind of data type I should use in SQL? datetime?

Thanks in advance for help :)

Regards,
John

What is the best practice for sum up the time?

Posted: Tue Jun 29, 2010 7:24 am
by Jan
Hello John,

Our report engine have SumTime aggregate function which you can find in report dictionary. This function accepts TimeSpan objects.

Thank you.

What is the best practice for sum up the time?

Posted: Thu Jul 22, 2010 6:06 am
by ssaturn
Jan wrote:Hello John,

Our report engine have SumTime aggregate function which you can find in report dictionary. This function accepts TimeSpan objects.

Thank you.
I tried using it

{SumTime(reportTimeShift.tsd_value)}

return result is 0:00:00

I am not sure "reportTimeShift.tsd_value" how it should be, I store the value as bigint in sql. Any datatype conversion need to be done here?

What is the best practice for sum up the time?

Posted: Fri Jul 23, 2010 12:48 am
by Jan
Hello,

Yes of course you need convert your values to TimeSpan type, because SumTime function can work only with TimeSpan type. You can use following expression to convert your values to TimeSpan:

Code: Select all

TimeSpan.FromDays(double value)
TimeSpan.FromHours(double value)
TimeSpan.FromMilliseconds(double value)
TimeSpan.FromMinutes(double value)
TimeSpan.FromSeconds(double value)
TimeSpan.FromTicks(long value)
Thank you.

What is the best practice for sum up the time?

Posted: Fri Jul 23, 2010 3:10 am
by ssaturn
Well, I have another question on how to convert a time (sec) into hh:mm Format in Cross Tab.

I have a value like 27900 sec in Cross Tab, then I do function (27900/60)/60 instead of 7.75, it gave me 7.. this is not what I want :(

I wish there is a Converter that ca convert Sec to Hour/Min (hh:mm)

What is the best practice for sum up the time?

Posted: Fri Jul 23, 2010 9:25 am
by Jan
Hello,

Code: Select all

TimeSpan.FromSeconds(value)
Thank you.

Re: What is the best practice for sum up the time?

Posted: Thu Aug 26, 2021 11:09 am
by Nirali213
Hello, i have a question of how to merge two same row and sum up time of that row which is diffrent. I am using Version 2020.1.1 from 18 December 2019, PHP, JS.

Re: What is the best practice for sum up the time?

Posted: Thu Aug 26, 2021 11:11 am
by Nirali213
I attached my report here please reply me as early as possible.

Re: What is the best practice for sum up the time?

Posted: Fri Aug 27, 2021 10:01 am
by Lech Kulikowski
Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more detail?

Thank you.