Click to See Complete Forum and Search --> : time conflict


dummyagain
June 1st, 2005, 11:51 PM
i would like to know if there are any method to check time conflicts using mysql? (the selected time (time c) should not be within some period of time( say, time a and time b)

Thanks

ovidiucucu
June 2nd, 2005, 12:03 PM
# TIME field type:
SELECT * FROM a_table
WHERE time_field NOT BETWEEN '02:11:43' AND '02:11:49'

# DATETIME and TIME field types:
SELECT * FROM a_table
WHERE DATE_FORMAT(datetime_field,'%H:%i:%s') NOT BETWEEN '02:11:43' AND '02:11:49'