Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bimanbeginner
Contributor II
Contributor II

Interval match

Hi

I have one table.

Schedule:

Load

[Schedule Start],

[Schedule End]

From Schedules:

This time format of both fields is 'YY/MM/DD hh:mm:ss'

I need to find all the times between the start and end time eg:

[Schedule Start]=17/06/13 13:33:00

[Schedule End] =17/06/13 13:36:00

I would like my field to return :

TimeRange field:

17/06/13 13:33:00

17/06/13 13:34:00

17/06/13 13:35:00

My point is to show how long my schedule was running down to the minute level and maybe another field going to second level.

if there is an easier way to do this other than an interval match please advise.

Thank You

1 Solution

Accepted Solutions
sunny_talwar

Sample script

Table:

LOAD *,

  TimeStamp(Schedule_Start + ((IterNo()-1)/(24*60))) as TimeRange

While Schedule_Start + (IterNo()/(24*60)) <= Schedule_End;

LOAD * INLINE [

    Schedule_Start, Schedule_End

    17/06/13 13:33:00, 17/06/13 13:36:00

];

View solution in original post

4 Replies
sunny_talwar

May be use a while loop here:

Loops in the Script

sunny_talwar

Sample script

Table:

LOAD *,

  TimeStamp(Schedule_Start + ((IterNo()-1)/(24*60))) as TimeRange

While Schedule_Start + (IterNo()/(24*60)) <= Schedule_End;

LOAD * INLINE [

    Schedule_Start, Schedule_End

    17/06/13 13:33:00, 17/06/13 13:36:00

];

bimanbeginner
Contributor II
Contributor II
Author

Thank You , if I wanted to go down to seconds would I Do the below?

Table:

LOAD *,

  TimeStamp(Schedule_Start + ((IterNo()-1)/(24*3600))) as TimeRange

While Schedule_Start + (IterNo()/(24*3600)) <= Schedule_End;

LOAD * INLINE [

    Schedule_Start, Schedule_End

    17/06/13 13:33:00, 17/06/13 13:36:00

];

sunny_talwar

Yes, you got the trick