+ 8

Dynamic hotel rates

I have table of rates with columns [check-in, check-out, price] 2021-05-12 2021-05-18 30$ 2021-05-19 2021-05-23 35$ now if clients search for date range 2021-05-15 to 2021-05-22 rate must be calculated from two rows 3 days from first row and 4 from second need the query for dynamic rates changes

12th May 2021, 12:25 PM
Shahghasi Adil
Shahghasi Adil - avatar
7 Answers
+ 5
SELECT TOP number|percent column_name(s) FROM table_name WHERE condition;
12th May 2021, 1:32 PM
JOY
JOY - avatar
+ 5
S-Adil 👑 show me the table
12th May 2021, 1:36 PM
JOY
JOY - avatar
+ 2
JOY it's not about that you think clients search in date range where it exists between two rows
12th May 2021, 1:35 PM
Shahghasi Adil
Shahghasi Adil - avatar
+ 1
if I search for date range 2021-05-12 to 2021-05-22 this row rate isn't exists it must calculated from both rows 30$ 35$
12th May 2021, 1:37 PM
Shahghasi Adil
Shahghasi Adil - avatar
0
rates table check-in check-out price 2021-05-12 2021-05-18 30$ 2021-05-19 2021-05-23 35$
12th May 2021, 1:40 PM
Shahghasi Adil
Shahghasi Adil - avatar
0
JOY check-in and check-out is date range from - to
12th May 2021, 1:41 PM
Shahghasi Adil
Shahghasi Adil - avatar