On Tue, 30 Mar 1999 12:33:05 -0800, Mike Machado wrote:
>Now I want to know everyone who was logged in between '1999-03-29
>02:00:00' and '1999-03-29 04:00:00'
If "between" means "at any time in the interval", the set you want is
the union of:
logged in before [low] and did not log out before [low] (already on
when the interval started)
logged in after [low] and before [hi] (during the interval)
So if your range is Tin...Tout
... WHERE Tin < [low] AND Tout > [low] OR Tin > [low] AND Tin < [hi]
If "between" means "during the entire interval" you're looking for Tin
< [low] and Tout > [hi]. Also, depending on what you mean with between,
the equal condition may need to be included (i.e. > maybe should be >=,
etc).
-Sincerely, Fred
(Frederik Lindberg, Infectious Diseases, WashU, St. Louis, MO, USA)