I am working on a calendar project and I am a stuck. I have a table where there are two datetime columns for time start and time end. The problem I am have is querying those columns to check that dates I am about to add do not conflict with existing dates.
for instance:
I may have a row with a time_start = 2003-07-21 08:00:00
and time_end = 2003-07-22 11:30:00
I now want to do a query to check if new_time_start = 2003-07-22 06:00:00 and new_time_end = 2003-07-22 12:30:00 conflicts with the above row
I have been ages trying to get this to work with no joy. Knowing my luck it's something simple, but I will appreciate the help anyway.
I have already tried that and in instances WHERE $new_start' = 2003-07-21 06:00:00 and '$new_end' = 2003-07-22 12:30:00 the formula whould fail to work even though this time period is overlaping. At the moment using these variations I seem to be getting all records or nothing, but not the required.
Stoker, I clearly did'nt look at what you posted earlier, cause what seems to be working is a variation the same thing. If any body can see any holes let me know, although I have yet to find any.
WHERE time_end >'$new_start'OR time_start >'$new_end'