Hello,
I'm fairly new to Access, and I hesitate to post this because I know I'm going to sound stupid. But here it goes.
I have five tables. In each table, we track business transactions by day (friday for example), one table for each of the last 5 weeks (so, eventually there are going to be 35 tables. Probably not the most effective way, but because of how my forms need to be set up, and some issues I'm having with relationships between tables, this seems to work best).
The fields are "Total rental" "Gold Rental" and "Total Returns" with a numberal behind each one to signify whether it is week 1, week 2, or so on.
Off of each table, there are 4 queries (though there will be five shortly). The first query subtracts "Gold rentals" from "Total Rentals" to give us the number of regular rentals performed in any given hour.
The second, third and fourth queries add up the total rentals for the day, and then divides the hourly total in each category to give us a percentage. So, it will tell us a percentage of our business being done at 12 midnight, then 1 am, 2 am and so on. There is a query for Total Rentals, Gold Rentals, and Counter Rentals. Eventually there will be one for returns.
For the purpose of this problem, let's use the Counter Rentals. In the first field of the query
there is a totals, that adds up all of the counter transactions for the day. In the second field, we have midnight's transactions being divided by total transactions. This comes out correctly, no problems at all.
Lastly, there are three queries that give us an average of business for the hour for the last five weeks. In the field that would represent 12:00 am, I have [counter1_0]+[Counter2_0]+[counter3_0]+{Counter4_0]+[Counter5_0]/5 (the number of weeks we are adding together. This should tell me a how much of my business over the last 5 weeks should be done at midnight.
But for some reason, it's not coming out correctly. Midnight transactions average out to around 4% of my business. According to access, it's coming out at a little over 10%.
Can someone please help explain what I'm doing wrong in the last query? I'm losing my mind over this!
Thanks very much for your help.
Last edited by just_some_guy; 08-05-2010 at 07:24 PM.
Your formula shown above only divides the [Counter5_0] by 5. You need to use brackets to evaluate the sum before dividing ie
([counter1_0]+[Counter2_0]+[counter3_0]+[Counter4_0]+[Counter5_0])/5
Huron,
Thanks very much. That fixed the problem. I really should have seen that.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks