This is from one of my assignments in Microsoft Access Use the data in tblReserv
ID: 3916741 • Letter: T
Question
This is from one of my assignments in Microsoft Access
Use the data in tblReservations and tblRoomCharges to create a query that calculates the attendants’ gratuity on a room service order (18%) or spa treatment (25%). Your query results should display ReservationID, CheckInDate, ChargeCategory, ChargeAmount, and a calculated field named Gratuity in that order. If the ChargeCategory is not a spa treatment or room service, a zero should be displayed in the field.
Use the data in tblReservations and tblRoomCharges to create a query that calculates the attendants’ gratuity on a room service order (18%) or spa treatment (25%). Your query results should display ReservationID, CheckInDate, ChargeCategory, ChargeAmount, and a calculated field named Gratuity in that order. If the ChargeCategory is not a spa treatment or room service, a zero should be displayed in the field.
Explanation / Answer
If you have any doubts, please give me comment...
SELECT ReservationID, CheckInDate, ChargeCategory, ChargeAmount, IIF([ChargeCategory]='Room Service', 18, IIF([ChargeCategory] = 'SPA treatment', 25, 0)) AS Gratuity
FROM tblReservations R, tblRoomCharges RC
WHERE R.ReservationID = RC.ReservationID;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.