Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 11th, 2004, 04:27 PM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL Double Booking System URGENT help needed!

Hey every1 - i am having a lot of trouble with this and any help would be much appreciated. I have an access 2003 database that i have created which is used primarily as a booking system for villas. I want to be able to design a system that prevents me from making a double booking. I have been advised that the best way of doing this is with a query. In english, i want the following out of my query:

Search through tblRentals for PropertyID that has just been entered

If the start date that has just been entered is >= to the start of any booking for this property, and the end date is <= to the end of any booking for this property, then display a message box "property double booked" and don't save any data.

OR

If the start date that has just been entered is <= to the start of any booking for this property, and the end date is >= to the end of any booking for this property, then display a message box "property double booked" and don't save any data.

OR

If the start date that has just been entered is <= to the start of any booking for this property, and the end date is <= to the end of any booking for this property, and the end date that has just been entered is > start date of any booking for this property, then display a message box "property double booked" and don't save any data.

OR

If the start date that has just been entered is >= to the start of any booking for this property, and the end date is >= to the end of any booking for this property, and the end date that has just been entered is < start date of any booking for this property, then display a message box "property double booked" and don't save any data.

OR

If the end date that has just been entered <= start of any booking for this property and the start date that has just been entered >= end of any booking for this property then display message box "booking successfull" and save data in tblRentals

WOW!!!! Lot of info there guys any help would be much appreciated. Fields in tblRentals are PropertyID, DateStart, DateEnd, and CustomerID. I am so confused about all of this!!!!!!!

Chris Smith





Similar Threads
Thread Thread Starter Forum Replies Last Post
booking system newbie07 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 July 19th, 2007 04:17 PM
Appointment Booking System newbie07 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 2 July 18th, 2007 08:32 AM
Casting System::Object __gc * to System.Double[] nepsat Visual C++ 3 November 19th, 2005 12:51 PM
booking system: first time using dates whyulil Classic ASP Basics 1 October 13th, 2004 09:03 PM
Celendar Booking System acdsky Classic ASP Basics 0 March 31st, 2004 02:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.