Hello,
I'm running mysql 4.0.12

I have a bookings database in which I'm having problems pulling out the
available accomodation.

Tables are:
Accomodation - accomid (primary key), town, address, contactnumber etc
student_accom - studentaccomid (primary key), accomid, studentid

My query is as follows so far, this is pulling out all the accomodation that is
booked between specified dates - not what I'm after -

SELECT distinct accomodation.accom_id FROM accomodation LEFT JOIN student_accom
ON accomodation.accom_id = student_accom.accom_id where
((student_accom.start_date Between '2005-10-01' And '2005-11-30') OR
(student_accom.leave_date Between '2005-10-01' And '2005-10-30'))

Appreciate any assistance.

Thanks
Gavin

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to