Question 1:
I have reservation database in access 2007 I have a cabin information table with:
cabinid (primarykey)
cabinname(text)
cabinlocation(t ext)
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!
3 2256 Rabbit 12,516
Recognized Expert Moderator MVP
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.
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.
Rabbit 12,516
Recognized Expert Moderator MVP Table1
CabinID 1
2
3 Table2
CabinID
ADate; Arrival Date
DDate; Departure Date 2, 1/1/2007, 1/31/2007 Query1 -
PARAMETERS ArrDate DateTime, DepDate DateTime;
-
SELECT Table2.CabinID
-
FROM Table2
-
WHERE ((([ArrDate]) Between [ADate] And [DDate])) OR ((([DepDate]) Between [ADate] And [DDate]));
-
Query2 -
SELECT Table1.CabinID
-
FROM Query1 RIGHT JOIN Table1 ON Query1.CabinID = Table1.CabinID
-
WHERE (((Query1.CabinID) Is Null));
-
Results - ArrDate = 1/3/2007 AND DepDate = 3/1/2007
CabinID 1
3 Sign in to post your reply or Sign up for a free account.
Similar topics |
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.
(1)Content-Length: (length of content which will be transmitted)
(2)Content-Type: (by
|
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.
The part of the program that sends an email states this:
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
if (isset($_REQUEST)){ $headers .= 'Bcc: '.$bcc....
|
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 instance, {"/bin", "/root", "/usr"}), how
to define a "blanklist" type use simpleType to
implement this, or any other advices?
Thanks !!
|
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 _uploadedfiles_xxxx) (php must be allowed to move uploaded files to this folder' - uploadedfiles_xxxx.
I typed <?php chmod ('_uploadedfiles_xxxx',640); ?> into notepad and saved it as php in the uploaded_xxxx folder, when I went to test it, the error...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |