473,388 Members | 1,256 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

double booking reservations and "blacklist" question

Question 1:

I have reservation database in access 2007 I have a cabin information table with:
cabinid (primarykey)
cabinname(text)
cabinlocation(text)

I have a customer table with:
customer id(primary key)
last name (text)
first name (text)
address(text)

I have a reservation table with:
reservationid (primary key)
customer (looks up to customer table)
cabin(looks up to cabin information table)
todays date (dd/mm/yyyy)
arrival date (dd/mm/yyyy)
departure date (dd/mm/yyyy)

Now this should be simple.. I need to prevent double booking a cabin reservation. I want the user to be able to enter an arrival date and departure date on a form, click a command button and have it open a reservation form with all cabins that are available between those dates. The user can then select a cabin and enter the reservation.
(also cabins can be rented out again on the departure day as well but since this is standard, no specific hourly times need to be added to tables).
This has been driving me crazy. I am having a brain freeze over something simple.

QUESTION 2:
I'd like to create a "blacklist" of customers so that a warning box or some bells and whistles appear to warn the user if they try to rent a cabin again.
I'm not sure how to go about doing this.
Thanks in advance to all!
Aug 13 '07 #1
3 2222
Rabbit
12,516 Expert Mod 8TB
You'll need two queries. One will return all CabinIDs where the arrival and departure dates overlap. The other will return all unmatched Cabin IDs.

As for the blacklist. Create an extra field in the customers table as a yes/no field. Then you can DLookup that field to see if they've been blacklisted.
Aug 13 '07 #2
You'll need two queries. One will return all CabinIDs where the arrival and departure dates overlap. The other will return all unmatched Cabin IDs.

As for the blacklist. Create an extra field in the customers table as a yes/no field. Then you can DLookup that field to see if they've been blacklisted.
I know there is the old "give a fish/teach to fish" thing but I'd really like to know in more detail how to create these queries in that manner.
Aug 13 '07 #3
Rabbit
12,516 Expert Mod 8TB
Table1
CabinID
1
2
3


Table2
CabinID
ADate; Arrival Date
DDate; Departure Date
2, 1/1/2007, 1/31/2007

Query1
Expand|Select|Wrap|Line Numbers
  1. PARAMETERS ArrDate DateTime, DepDate DateTime;
  2. SELECT Table2.CabinID
  3. FROM Table2
  4. WHERE ((([ArrDate]) Between [ADate] And [DDate])) OR ((([DepDate]) Between [ADate] And [DDate]));
  5.  
Query2
Expand|Select|Wrap|Line Numbers
  1. SELECT Table1.CabinID
  2. FROM Query1 RIGHT JOIN Table1 ON Query1.CabinID = Table1.CabinID
  3. WHERE (((Query1.CabinID) Is Null));
  4.  
Results - ArrDate = 1/3/2007 AND DepDate = 3/1/2007
CabinID
1
3
Aug 13 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: mike | last post by:
regards: I write java code to simulate my machine as a HTTP server, what is the "MUST REPLY" HTTP response headers? In my small survey,I think there are 2 "MUST REPLY" HTTP response headers....
4
by: Jason | last post by:
I'm troubleshooting a program that I didn't build, so forgive me on this one. It's called email.php, and it looks like a program that the original developer must have downloaded from somewhere. ...
3
by: Peter Wang | last post by:
Hi all, I want to write a schema file to validate my xml file, and encounter a problem as follow. the xml file contains a <pathnode£¬whose value should be a string not included by a blanklist(for...
5
by: camphor | last post by:
hi, I have found an upload script in hotscripts and have implemented it into the website, I followed the installation steps to 'give write permissions to php on the upload folder (which is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.