Use Left outer Join
SELECT bookings.*,times.slotId FROM bookings
LEFT OUTER JOIN TIME
on bookings.slotId=TIME.slotId
WHERE bookings.DATE='$date' AND bookings.stylist='$stylist'
ORDER BY TIME.startTime"
having time.slotId is null
Last edited by peter_budo; Feb 3rd, 2009 at 2:03 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 22
Solved Threads: 9
Junior Poster in Training
Offline 83 posts
since Jun 2008