1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Windows MS Access query help needed

Discussion in 'Software' started by burnoutuk, 17 Oct 2003.

  1. burnoutuk

    burnoutuk What's a Dremel?

    Joined:
    18 Feb 2003
    Posts:
    417
    Likes Received:
    3
    I need to make a query that displays pitches at a campsite that are not booked for a given date the user enters.

    [​IMG]


    I have a tbl which holds pitch info tblPitch and a table which holds booking info tblBooking (see attachment)

    tblBooking has the pitch number, start date and end date so if theres a date like 1/11/2003 - 7/11/2003

    if the user enters a date on or between then i dont want that pitch to be displayed but all pitches that arnt booked to be shown...

    im not sure if this makes much sense but if someone gets it please help im new to this.

    Heres what ive been trying

    SELECT DISTINCT [tblpitch].[siteNo], [tblpitch].[pitchNo]
    FROM tblpitch, tblBooking
    WHERE tblpitch.pitchNo = tblbooking.pitchNo

    And tblBooking.bookingDate between [Enter Date]

    and tblbooking.pitchNo NOT IN (select pitchNo from tblBooking)
    ORDER BY [tblpitch].[siteNo];


    but its wrong as i have no end date or anything.


    Thank you for any help.
     
Tags:

Share This Page