COmpletely confused about doing calculationsin queries (1 Viewer)

Erica Nichols

New member
Local time
Today, 09:59
Joined
Mar 23, 2012
Messages
3
Hello
I have a small table for a hotel with 30 rooms.....3 room types. I have to find out:

1. The average length of stay per room type
2. The average # of visitors per room type
3. The base income per room length of visit x daily rate) during a specified period of time (a single month)

I have the following fields:
First Name
Last Name
Room Name
Room Type
Arrival Date
Departure Date
# Guests
Daily Rate

I have been able to do a query including the room type, arrival and departure dates.

I have been doing a bunch of online learning for access but it is not helping. Maybe I am taking the wrong online courses. Can anyone help me to understand how to make calculations and where they are placed in a query.
:confused:
Thank you
Erica
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 08:59
Joined
Sep 12, 2006
Messages
15,656
sounds tricky

lets take the first one

average length of stay

a) you need to count the stays
b) you need to count the duration of each stay

then b) divided by a) gives you the average. so you need to develop queries to give each of the above as a first step. have you been able to do this?
 

Erica Nichols

New member
Local time
Today, 09:59
Joined
Mar 23, 2012
Messages
3
I have found some internet information which suggests creating an additional column and shows how to calculate the stay.

This will show me the days for each record. I then need to average the stay per room type so I think I will create a seperate query for each room type.

I do not know how to add the stay column and divide my the number of room.
 

Erica Nichols

New member
Local time
Today, 09:59
Joined
Mar 23, 2012
Messages
3
I tried entering a new field onto the query

Stay: (Departure Date)-Arrival Date)

This is what the internet info suggested but it gave me an error message saying I may have entered an operand without an operator.

So, back to not knowing how to do it
 

MSAccessRookie

AWF VIP
Local time
Today, 03:59
Joined
May 2, 2008
Messages
3,428
I tried entering a new field onto the query

Stay: (Departure Date)-Arrival Date)

This is what the internet info suggested but it gave me an error message saying I may have entered an operand without an operator.

So, back to not knowing how to do it

I would like to start with the most obvious issue that I see:

Your variable names appear to have special characters and reserved words in them (DATE is a reserved word that refers to a Function that provides DATE related information, and spaces are considered special characters). In order to use such variable names, you will need to surround them with brackets

( Stay: [Departure Date]-[Arrival Date] ).

A better way might be to create variable names that do not have special characters or reserrved words.

( Stay: DepartureDate-ArrivalDate ).
 

Users who are viewing this thread

Top Bottom