1. Junior Member
Join Date
Dec 1969
Posts
2

I have a BIG problem...<BR>I am really stuck on how to achieve this for aa hotel booking application.<BR><BR>Here is a rate card for the hotel:-<BR><BR>Jan 8th - March 31st<BR> Daily Rate = 19.00<BR> Week Rate = 125.00<BR>April 1st - June 30th<BR> Daily Rate = 20.00<BR> Week Rate = 130.00<BR>July 1st - Sept. 17th<BR> Daily Rate = 22.00<BR> Week Rate = 140.00<BR>Sept 18th - Dec 3rd<BR> Daily Rate = 20.00<BR> Week Rate = 140.00<BR>Dec 4th - Jan 7th<BR> Daily Rate = 21.00<BR> Week Rate = 135.00<BR><BR>If someone stays for 10 days, they are charged a week rate and then 3 day rates... should someone stay for 14 days, they are charged 2 week rates, etc.<BR><BR>If someone wants to stay 1 week and that stay overlaps rate periods ie, from dec 1st then they are charged the week rate as it is on their arrival day. If they were staying for 2 weeks from dec 1st, then the 1st week would be at one rate and the second week at a different rate.<BR><BR>If someone was staying for 10 days for instance from dec 1st, then they would be charged 1 week @ 140.00 and 3 days at 21.00.<BR><BR>I hope the above is understandable.<BR><BR>If I know the start date and the end date, how the hell can work out the cost??<BR><BR>Any help would sure save me from buying more valium!!<BR><BR>Rob<BR><BR>

2. Senior Member
Join Date
Dec 1969
Posts
213

3. Senior Member
Join Date
Dec 1969
Posts
96,118

## Are you trying to do this with SQL???

Or is a VBScript solution adequate?<BR><BR>First thing you need to do is change that last condition:<BR><BR>Dec 4th - Jan 7th<BR>Daily Rate = 21.00<BR>Week Rate = 135.00<BR><BR>So it becomes:<BR><BR>Dec 4th - Dec 31st<BR>Daily Rate = 21.00<BR>Week Rate = 135.00<BR>Jan 1st - Jan 7th<BR>Daily Rate = 21.00<BR>Week Rate = 135.00<BR><BR>And then, of course, move the Jan 1st segment to the top of the list.<BR><BR>

4. Senior Member
Join Date
Dec 1969
Posts
96,118

## Sorry...didn't notice which forum...

...I was in. Okay, so in SQL or VB.NET?<BR><BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•