Claudine, I have a routine written in transact-sql, easily translatable to RBASE that identifies overlapping time periods. I have to dig out the code and post it. But it identifies time periods where the start time and/or end time overlaps a set of times within the database.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Claudine Robbins Sent: Saturday, March 03, 2012 1:33 PM To: RBASE-L Mailing List Subject: [RBASE-L] - Time Overlap Hello all, I'm trying to programmatically identify overlapping hours in sets of start/end time records for a maximum 24 hour period for vehicle usage, something that the human eye readily sees such as: Start End 10:00:00 12:00:00 9:00:00 13:00:00 Where the second row overlaps the first by 2 hours (1 hour earlier and 1 hour later) so that I could visually see the allowable time segment as the second one and disregard the first. In the following example, however: Start End 10:00:00 12:00:00 08:00:00 11:00:00 I have to take the first row into account with 1 hour later end time than the second row and 2 hours earlier than the first start time. I can still see that the result is allowing the end time of the first row and the start time of the second row. It gets complicated where there are multiple rows and partial minutes involved thus the need to be able to calculate the total time shared by all the rows without making the user go blind trying to visualize the overlapping hours. Best scenario would be to prevent the user from adding an overlapping segment at data entry validation. Typical entry example: Date Start End Vehicle 01/01/12 5:00:00 11:30:00 234 01/01/12 11:30:00 18:00:00 234 01/01/12 17:30:00 0:00:00 234 Perhaps someone on the list has already tackled this problem or someone can give me a hint in what direction to take my calculations. Thank you very much in advance, Claudine

