3 Replies Latest reply: Mar 28, 2017 11:57 PM by Alex Bernea

# Intervals between timestamps in hours with fractions of a day for interval ends

Hello,

I am trying to break the interval between 2 timestamps in order to find out the difference in hours per day with fractions for intervals

I have the following input data:

StartTimeEndTime
02/08/17 20:4402/10/17 04:52

I would like to show them as:

StartTimeEndTimeTime elapsed
02/08/17 20:4402/09/17 00:0003:16
02/09/17 00:0002/10/17 00:0024:00
02/10/17 00:0002/10/17 04:5204:52

I tried while loops and intervals, but I can't find a way to break correctly the edges of the intervals (those that are not full day)

Thank you,

Alex

• ###### Re: Intervals between timestamps in hours with fractions of a day for interval ends

Try sing interval function explained here.

something like interval(Endtime-StartTime,'HH:MM')

• ###### Re: Intervals between timestamps in hours with fractions of a day for interval ends

Try this

Table:

Interval(EndTime - StartTime, 'hh:mm') as [Time Elapsed];

LOAD TimeStamp(RangeMax(DayStart(StartTime + IterNo()-1), StartTime)) as StartTime,

TimeStamp(RangeMin(DayStart(StartTime + IterNo()-1, 1), EndTime)) as EndTime

While Floor(StartTime) + IterNo() <= Floor(EndTime + 1);