Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7663369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:02:48+00:00 2026-05-31T14:02:48+00:00

I didn’t know how to express this problem that well in word form so

  • 0

I didn’t know how to express this problem that well in word form so have decided to use pictures to help me.

These are my tables and their relationships:
enter image description here

and here is the form I’m stuck on:
enter image description here

I’m trying to make the form so that when a start date and an end date are entered, a query in the caravan combobox’s row source is ran which shows all the caravans that are not booked during that period. My SQL skills right now are limited as I’m currently learning them for this project. This is the SQL query I have made so far:

SELECT tblCaravan.caravanID, tblCaravan.caravanType
FROM tblCaravan, tblCaravansWeeksBooked
WHERE (((tblCaravansWeeksBooked.startDate) Not Between [txtStartDate] And [txtEndDate]) 
AND ((tblCaravansWeeksBooked.endDate) Not Between [txtStartDate] And [txtEndDate]));

I have the caravan combobox requery itself when it has focus using a Macro in Access.

The problem is the SQL I have made is not working and I can’t see why. I made it work before by using two queries built with the wizard which were these:

SELECT tblCaravansWeeksBooked.startDate, tblCaravansWeeksBooked.endDate, tblCaravansWeeksBooked.caravanID
FROM tblCaravansWeeksBooked
WHERE (((tblCaravansWeeksBooked.startDate) Between [Start Date] And [End Date]) 
AND ((tblCaravansWeeksBooked.endDate) Between [Start Date] And [End Date]));

and
SELECT tblCaravan.caravanID, tblCaravan.caravanType
FROM tblCaravan LEFT JOIN qryWeeksBooked ON tblCaravan.caravanID = qryWeeksBooked.caravanID
WHERE (((qryWeeksBooked.caravanID) Is Null));

I hope someone here can help push me in the right direction, thanks for any help that is given.

Jake

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T14:02:50+00:00Added an answer on May 31, 2026 at 2:02 pm

    Try this

    SELECT tblCaravan.caravanID, tblCaravan.caravanType
    FROM tblCaravan
    WHERE caravanID NOT IN (SELECT caravanID FROM tblCaravansWeeksBooked
                            WHERE startDate < Forms!MyForm!txtEndDate AND 
                                  endDate > Forms!MyForm!txtStartDate)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Didn't know how else to put this. Say I have a JavaScript method that
I didn't really know how to formulate the title. But this is my problem.
I didn't really know how to phrase this question, its quite strange. I have
I didn't want to write this Q on here but I decided that enough's
I didn’t found short form for this question as subject… Is it possible to
I didn't see any questions that asked this previously so here goes: Once you
Didn't even know how to exactly phrase this question, but here is the the
I didn't know how to Google this, it always came up with answers I
This didn't work: Setting the umask of the Apache user Arch doesn't have a
I didn't know if this should be posted here or on Programmers - Sorry.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.