Jump to content

Guest House Reservations database


jfrick

This topic is 8306 days old. Please don't post here. Open a new topic instead.

Recommended Posts

My database consist of 4 files; reservations, house, guest and calendar. I want a portal showing how many rooms (of 22) from the house file are available.

My reservations file contains arrival and departure date fields and a some calc fields that create a date range and room info.

I currently enter a date into a global date field that's related to the reservations file(many dates and rooms)which gives inaccurate results and can list the same room more that once. I think I needed another line items type file but I'm not sure. Hope I've given enough info. Can anyone help? crazy.gif" border="0

Link to comment
Share on other sites

Too much question, too little information...

What is a record in your reservation file?

What is a record in your house file?

Do you just want a single NUMBER showing room availability or do you want a LIST of rooms in a portal ("I want a portal showing how many rooms (of 22) from the house file are available")?

Your answer should have the form: "A records is a reservation for one guest one room for one day" or "A record is a reservation for one guest for one or more rooms for one or more days" etc.

-bd

Link to comment
Share on other sites

Answer: a LIST of rooms in a portal ("I want a portal showing how many rooms (of 22) from the house file are available") A record is a reservation for one (or more) guest(s) one room for one day or more(I've already figured out how to handle a range of dates.

If the user enters a date such as 8/4/2001 then I want to check the reservation file ArrivalDate and DepartureDate fields to see if 8/4/2001 falls between them.

Reservation file fields consist of: ReservID (key), HouseID, GuestID, ArrivalDate, DepartureDate, CalcDateRange, (from House file: CalcRoom#,CalcPhone, CalcBed, CalcBath). Calendar and Guest files at this point aren't important.

Link to comment
Share on other sites

Ok, I'll guess! A record in the house file is a room? wink.gif" border="0

The problem you have is you want to display the dates NOT reserved. To do this you must have an entry in some file for every room for every possible date (22*365 per year), and then break the key (or remove the record) when the room is reserved.

If you try to use the house file and make the key on the house file conditional on date in the reservation file based a reservation, it won't work, as the field used on the right side of a relationship can't be indexed.

As an alternative you can create the file of room/days (22 x 365 x years ahead), fill it ahead with all dates for all rooms, and change a field in this file (Avail?) using a script run from the reservations file. This "Avail?" field would be part of an composite key, maybe defined as:

Avail? (text) <--- value list "Yes", "No"

AvailDate (calculation, text, indexed) = Avail? & Date

In the main file (whichever the portal is in)

Enter the date into a global:

gDate (date)

and calculate a key field to used in the relationship with the file of room/days.

key (calculation, text, indexed) = "Yes" & Date

Base the portal upon the relationship between "key" in you main file and "AvailDate" in the room/date file.

-bd

[ August 04, 2001: Message edited by: LiveOak ]

Link to comment
Share on other sites

  • 2 weeks later...

This topic is 8306 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.