I need help with a section of my query that handles the "availability checking" aspect of my system. Unfortunately this has to be done in one query, I know how to do it in several with php if statements.
Currently if ANY of the entries are of the same year or month or day it will not return the results. I need it to not return results ONLY if the entry matches the year, day, and month.
How do I go about doing that?
Thanks,
-Ryan
Code:
(oc_calendar.username = balances.uid) AND
($day != DATE_FORMAT(oc_calendar.start_date, '%d')) AND
($day != DATE_FORMAT(oc_calendar.end_date, '%d')) AND
($month != DATE_FORMAT(oc_calendar.start_date, '%m')) AND
($month != DATE_FORMAT(oc_calendar.end_date, '%m')) AND
($year != DATE_FORMAT(oc_calendar.start_date, '%Y')) AND
($year != DATE_FORMAT(oc_calendar.end_date, '%Y'))
Currently if ANY of the entries are of the same year or month or day it will not return the results. I need it to not return results ONLY if the entry matches the year, day, and month.
How do I go about doing that?
Thanks,
-Ryan












