Click to See Complete Forum and Search --> : Help with a query, I think.....


notjoe
January 31st, 2005, 08:45 AM
Hi, I need a little help please,

We have to create a booking system for a hotel. We have an arrival time, the date they arrive and the date they want to leave. And what type of room it is (i.e., single or double). We also have a room number. All this is in the SQL tables, and the ASP works fine for this part.

The problem and confusing part for me is that if a room is booked say for example from the 14th-17th of Feb 2005, and if somebody else wants to book the same room say on the 17th of Feb, the room comes up as being booked, however the people in that room will be departing then. So technically after the room has been cleaned the room will be available.

The best solution I can come up with is have a room available time. Guests currently staying in the room have to leave before say noon, say 2 hours for cleaning, and the room is available at 14.00 on that day, but how do I create that, and will it be using asp or sql?

I totally haven’t got a clue and would appreciate any help you guys could give me.

Thanks.

Hobson
January 31st, 2005, 09:00 AM
I think that you can workarount this problem in 2 ways:

1. If room is booked i.e. 16Feb to 22Feb, threat room at 22Feb as available in routine checking if the room is booked at given time span. I do not know how it is implemented in your application, so cannot give more details for now

2. Instead of storing days when room is booked, put into database also hours, lets say 16Feb 14:00 to 22Feb 12:00. If someone would like to book room from 22Feb 14:00, database should know that room is available.

Hope it helped
hob

notjoe
January 31st, 2005, 11:53 AM
I think the second option is the best solution, it's less complicated than the first. Your help is really appreciated. It's great to get fresh ideas and I didnt even think about including times. Thankyou v. much.