Showing posts with label double booking solution. Show all posts
Showing posts with label double booking solution. Show all posts

Thursday, 19 March 2009

Welcome to the Hotel California (The Room Invoice Query Thingummy)

Plenty of room. Any time of year, you can find it here.

Especially with a brand spanking new IT system to sort out the room booking thingummy.

The tables are easy enough to sort out. You can see from the diagram that we've got tblCustomer linking to tblBooking which also links to tblRoom. Note that the links need to have their referential integrity enforced (oh, lovely...).

You then need a query taking data from the three tables to work out the length of stay and the price to get a final price sorted out.

This is where the screenshot comes in...

Err, click on the image and it gets big enough to read...

There are other ways to work out the length of time (using the Date Diff thingy), but for now I've stuck with a simple sort of method. I think it'll do the basics.

All you do then is multiply the length of stay by the Price per night to get a total cost. If you use the same method as in the Order Form Dilemma below you should be able to get that cost into a data entry form - although you may well find that there's no real need to use the sub-form method after all: there's probably at least one other way around this problem.

I wonder whether this can be combined with the Double Booking Solution, perhaps using an adding to a table method, to make sure that there's a way of not selling the same room twice.

That would be bad. Wouldn't at all suit the Hotel California. Such a lovely place.

Thursday, 5 February 2009

Double Booking Solution to a Database

We were talking about this at work the other day - how do you solve a problem like double booking a hotel room or a car hire (or, for that matter, Maria)?

There are various solutions, but a dead easy one it laid out in the textbook we give our sixth form AS students. If you had that book in front of you then you'd go to page 193 and find that it was quite complex looking, but really dead easy. There needs to be some thinking done as to how exactly to get it work of course, but we'll get there with that. Perhaps.

I'll add some screenshots to this when I get the chance.