Hi everyone.....
I have following SQL code.
Code:
SELECT Reservations.[Room Type], Avg(DateDiff("d",[Arrival Date],[Departure Date])) AS [Avg Length of Stay], Avg(Reservations.[No of Guests]) AS [Avg # of Visitors], Avg(Reservations.[Daily Rate]) AS [Daily Rate]
FROM Reservations
GROUP BY Reservations.[Room Type]
ORDER BY Reservations.[Room Type];
and
Code:
SELECT Avg_Length_of_Stay.[Room Type], Format(Avg([Daily Rate]*[Avg Length of Stay]),"Currency") AS AvgBill
FROM Avg_Length_of_Stay LEFT JOIN Reservations ON Avg_Length_of_Stay.[Room Type] = Reservations.[Room Type]
GROUP BY Avg_Length_of_Stay.[Room Type];
Now here is the dilemma. This code is for 1-4 guests per night. But if there is a fifth and sixth guest, they must pay an additional $20 EACH per day. How would I alter the code to make up for this point.