Plz help. SQL help needed.

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. :blush:)
 
S

Steve S

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....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SQL query help 4
SQL query error 3
###Query help needed 2
Help please!!! 6
query help 1
Query and variables help. 4
Help with query please 4
Prob... please Help.... KRISH 1

Top