Hi everyone
I am trying to create a query that will display only the people who are available on a given date. So I have a table full of people, and a table in which I record when they are not available.
My tables are:
person : personID, personName, personType
personType: personTypeID, personTypeName
unavailable: unavailableID, unavailablePersonID, unavailableDate
My query is:
SELECT personName, personID, unavailablePersonID, unavailableDate, personType, personTypeName, personTypeID
FROM person
LEFT JOIN unavailable ON unavailableDate = '2004-12-12'
LEFT JOIN personType ON person.personType = personType.personTypeID
WHERE person.personID != unavailable.unavailablePersonID
AND personTypeName = 'Musician'
LIMIT 0 , 30
That works fine as there is an entry in the unavailable table for the 2004-12-12.
However, when I change the date to one in which there are no records in the unavailable table, I get no results instead of a list of everyone!
Help!
Thanks
Daniel