Q
Question Boy
I am having a hard time writing a query to check for availability (time wise).
I have a table 'tblUsr_Avail' which has 3 fields 'sDate','sTime','eTime',
where sDate is the date the usr has booked off, sTime is the start time they
have booked off and eTime is the end time they booked off. basically the
sTime and eTime define a window when the user is not available.
Now for the problem. i am trying to write a query to check if a booking
window of time conflicts with the time booked off by the user and am getting
nowehere. The logic is eluding me because there are so many possibilities.
can someone offer any guidance or an example that I might learn how to do
this.
A concrete example:
Suppose the user booked off today (sDate='2008-10-23') between 11:00 (sTime)
and 13:30 (eTime) and we are trying to validate with a query that an
appointment scheduled today from 10:30 until 12:00 does not conflict, How
would I structure my SQL to check?
Thank you so very much for your help!!!
QB
I have a table 'tblUsr_Avail' which has 3 fields 'sDate','sTime','eTime',
where sDate is the date the usr has booked off, sTime is the start time they
have booked off and eTime is the end time they booked off. basically the
sTime and eTime define a window when the user is not available.
Now for the problem. i am trying to write a query to check if a booking
window of time conflicts with the time booked off by the user and am getting
nowehere. The logic is eluding me because there are so many possibilities.
can someone offer any guidance or an example that I might learn how to do
this.
A concrete example:
Suppose the user booked off today (sDate='2008-10-23') between 11:00 (sTime)
and 13:30 (eTime) and we are trying to validate with a query that an
appointment scheduled today from 10:30 until 12:00 does not conflict, How
would I structure my SQL to check?
Thank you so very much for your help!!!
QB