472,364 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,364 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 2141
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

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.