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.

1 comment:

Anonymous said...

Well...Hotel California was a good song.

Now it makes me think of my IT coursework.