Randy --
It's important to determine how the end points function. If the starting point of the "user described range" is considered to overlap the ending point of a record, then BETWEEN will work for you. An application similar to this did not consider this to be an overlap. In that situation, Garrett's approach will work for you.
Jay
>Hello Foxperts
>
>My current challenge is to develop an expression that will assist in selecting or filtering records in a table that has two DateTime fields that describe when a particular condition is happening.
>
>tBegin is a DateTime field
>tEnd is a DateTime field
>Together they describe a period of time
>
>I need to select all records that intersect a given period of time - this is something like set theory.
>
>Let's say that I'm interested in records that affect the time periond described as being from {^2003-07-04,15:30} to {^2003-07-07.06:30}.
>
>Record 1 tBegin={^2003-07-04,15:30}; tEnd={^2003-07-07,06:30}; is included.
>Record 2 tBegin={^2003-07-04,01:00}; tEnd={^2003-07-04,23:30}; is included.
>Record 3 tBegin={^2003-07-01,12:10}; tEnd={^2003-07-03,21:15}; is excluded.
>Record 4 tBegin={^2003-07-06,05:30}; tEnd={^2003-07-08,06:30}; is included.
>Record 5 tBegin={^2003-07-07,08:45}; tEnd={^2003-07-07,11:30}; is excluded.
>
>Here's a graphic attempt to describe the same thing:
>0 = not in time range
>1 = in time range
>00000111100000 <- user described time range
>00011110000000 <- record included
>00000001111000 <- record included
>00000011000000 <- record included
>01110000000000 <- record excluded
>00000000001111 <- record excluded
>
>Is this a monster IF or something that includes multiple BETWEEN()s, or a DO CASE???
>
>TIA for your prompting that will get me started.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only