Plz help. SQL help needed.

  • Thread starter Thread starter Eva
  • Start date Start date
E

Eva

Hi,

Im new to Vb.net and am trying to create my first
practice project. The problem iv encountered is to do
with SQL queries issued against my Access DB iv created.
i want to wright a query that will pull all the caravan
details that are available at a partuclar date which will
be entered by the user at the interface. The query will
have to ensure that the caravans are not booked by
another guest for that specifed date period. the 3 tables
i need are:

Guest Info table:
Booking No (PK)
Name
Addr
Date of Arrival
Date of Departure

Caravan Booking table:
Caravan model No (PK, FK)
Booking No (PK, FK)

Caravan details table:
Caravan model No (PK)
Cost/day
Beds in caravan.

Can anyone help me with this query? How do i include the
dates that the user enters on my interface using the
DateTimePicker control into this query?

thx for your time. :o)
 
based on your tables....... and the need to identify if a specific day is
available........

You didn't say how many of these caravans there were........ if there are
several...... it makes the problem more complex.......

but the bottom line is you probably will need to come from the angle of is
that field NULL..... ie... no reservation..... and take a join....
across all three tables..... starting at the details..... through the
booking..... back to the guest info....... just to see if they are
available......

You will run into an issue of........ start-end dates how you have the
tables lined up....... as you are not counting EACH day...... on a
seperate record...... making it more complex than if you had a table that
had a date for each day the caravan was booked....
 
Back
Top