If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Table design advice please

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-23-10, 04:47
PGH PGH is offline
Registered User
 
Join Date: Aug 2010
Posts: 2
Question Table design/Date Range Query Advice please

I am designing a database for our golf holiday company to store booking and customer data as well as create new quotes.

I'm looking for the smartest way to store hotel prices to accommodate both easy updating and the ability to retrieve room price data for a date range and calculate a total price for the length of stay.

So if my Hotel_Prices table contains the following, once the data has been entered into a form can I run a query that will calculate and return Cost and Sell totals for a date range (Check_In to Check_Out) if the date range covers two rows in the price table (Low and High) ?

Hotel_Name
Season (High,Low,Peak,Xmas)
Season_Start (Date)
Season_End (Date)
Room_Type
Cost_Single
Cost_Dbl
Sell_Single
Sell_Double

The obvious (and long winded option) is to store the prices individually for every single day of the year. The Quote query would then simply select the range for the arrive date to depart date and add each day's price together. This obviously means creating a massive amount of table data across all our hotels and room types which I'm hoping to avoid.

Thanks in advance for any assistance.

SB.
Phuket Golf Holidays

Last edited by PGH; 08-23-10 at 11:46. Reason: Additional Info
Reply With Quote
  #2 (permalink)  
Old 09-01-10, 17:27
Sam Landy Sam Landy is offline
Registered User
 
Join Date: May 2004
Location: New York State
Posts: 931
All you have to do is to be meticulous in your start and end dates for each category. In other words, the dates covering the four seasons you mention had better cover 365 (or 366) days exactly for each type of room, each amount of occupants, etc.: no overlaps; no gaps.

If you cover all these bases correctly, all you have to do in a query, or in VBA, is use the >, <, =, >=, and/or <= mathematical symbols on the various dates to find the total invoice amount.

Good luck. It really is tedious, but very rewarding when it works like a charm.

SL
Reply With Quote
  #3 (permalink)  
Old 09-02-10, 03:35
izyrider izyrider is offline
Cavalier King Charles
 
Join Date: Dec 2002
Location: Préverenges, Switzerland
Posts: 3,729
duplicate post

different subject but same text as this thread.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On