> Im trying (in SQL) to compare a user given start and end time to see if
> it falls in between a start and finish time in a database.
>
> I don't want the results if the start time or end time lies between these 2
> times.
WHERE fieldValue NOT BETWEEN table.StartTime AND table.EndTime
or
WHERE fieldValue < table.StartTime AND fieldValue > table.EndTime
-- Graham
Graham Dobson - 31 Jul 2003 16:02 GMT
> WHERE fieldValue < table.StartTime AND fieldValue > table.EndTime
>
> -- Graham
Oops should read
WHERE fieldValue < table.StartTime OR fieldValue > table.EndTime
as it would be hard to imagine a time both less than and greater than an
interval of time. The important thing to realize is that the date/time
value is actually part of a floating point number like any other floating
point number with the date as the whole number and the time as the
raction. -- Graham