Prices between two days - TechRepublic
Question
December 28, 2008 at 09:04 AM
alexmq8

Prices between two days

by alexmq8 . Updated 17 years, 6 months ago

This is my data base (availability)

Datefrom Dateto Hotelid Roomid Singleprice Doubleprice

10/1/2008 10/5/2008 H101 R101 10 20

10/7/2008 10/10/2008 H101 R101 5 7

10/11/2008 10/15/2008 H101 R101 7 9

10/16/2008 10/20/2008 H101 R101 6 9
If i search for 10/2/2008 to 10/8/2008 , result is not available (because 10/6 /2008 price is not available
If i search for 10/8/2008 to 10/19/2008 , result is available
Answer as 10/8/2008 to 10/19/2008 is available (11 days)
And single price =(5+7+6)/noofdays(11)
And doubleprice=(7+9+9)/noofdays(11)

Plz help me for writing one line sql query for this?

This discussion is locked

All Comments