5 Replies Latest reply on Aug 27, 2018 5:47 AM by Tobias Schubert

# Calculate duration with different days

Hi Com,

I'm trying the following, without success until now:

I got two colums from my data which contain start-date and end-date of a system process.

The format is like this: DD.MM.YYYY HH:MM:SS

I would like to have a calculation of the duration from start to end.

How should I do it so I also get the time difference including possible day differences.

Example:

start:                     01.10.2018 08:00:00

end:                      02.10.2018 09:00:00

expected result:    25:00:00

• ###### 1. Re: Calculate duration with different days

To get the difference between the times use a DATEDIFF calculation. Use the lowest level granularity - for example if you want to report the difference as low as in seconds then your calculation will be:

DATEDIFF('second',[Start],[End])

From the number of seconds you'll be able to build back up to the number of hours, mins, etc by using standard maths - ie. to get the hours divide the number of seconds by 3600 (60 secs * 60 mins)

1 of 1 people found this helpful
• ###### 2. Re: Calculate duration with different days

Hi,

Create one calculated filed and use this DATEDIFF function in that like below image.

Here I have taken 'hour' because I want that calculation in Hours. You can use minute or second as well instead of hour.

Please revert me if it doesn't work for you.

Best

Suman

• ###### 3. Re: Calculate duration with different days

Can I also somehow use more than only one type of time?

Like I want to have the exact time difference: 25:15:46 (HH:MM:SS)?

• ###### 4. Re: Calculate duration with different days

Sure, check this thread with the solution, converting seconds to hh:mm:ss. How to convert seconds data into HH:MM:SS

1 of 1 people found this helpful
• ###### 5. Re: Calculate duration with different days

Thank you very much, Andrew!

Also thank you Suman!