Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Most efficient approach

Status
Not open for further replies.

pgferro

Programmer
Aug 21, 2001
111
BS
Hi guys,

I'm in the analisys phase of a new application, a reservation system for the travel industry (SQL Server as db), and I need your suggestions on what would be the most efficient approach to the following situation :

Tipically, most services related to leisure travel have different prices depending on the season / period of the year. For example an Hotel Room would cost, let's say, 55 $ a night from April 1 to June 30 and 60 $ a night from July 1 to September 30.
Being this the case, I could come up with a client who needs the room in a period that crosses the two prices (June 27 to July 3) and I should be able to give the correct price calculating 4 nights @ 55 $ and 2 nights @ 60 $.

Any suggestion on how to efficiently manage this scenario will be greatly appreciated !!

Thanks - PG
 
Start by checking if the start date < season end and the end date > season end .

If true, figure out end date - season end to give number of days at one price

and

season end - start date to give number of days at other price.

Too easy - just make sure you aren't either counting the season end twice or not counting it at all.

If your xover date changes, make it a db field that can be updated as necessary

Steve Davis
hey.you@hahaha.com.au

Me? I can't even spell ASP!
 
Hi,
You could also make a lookup table containing
Date, roomCategory( in case they vary by location/amenities, etc.),rate and use this to
select the daily cost of any given room..Link this with the dates of the request and the cost should be derivable..
This method allows you to change rates. etc on only one table and have the new data instantly available..

just my 2c

[profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top