I have an option group on a form that has 16 different selections, and the values are 1-16. They are stored in a field Called Reg in a table named Sales.
What I'm needing to do is extract these values as something meaningful in a report by way of query. I need the query to find a particular number in Reg, say 7, and sum them all up. Basically 7 is the value for a sale called Standard, and 5 would be the value of Classic, etc. This is what my table looks like :
WorkOrder SalesID Reg Date
5500 13312 7 01/01/04
6600 13312 5 01/01/04
9999 55551 1 01/01/04
8800 13312 7 01/01/04
I need the query to take the 7's, and total them up in a field called SumOfStandard, and then the 5's, etc for each individual SalesID. Right now what I have is a Query with 16 nested queries in it, one to sum up each field. That's a problem itself, as far as the clutter of queries, but also I'm imagining for speed. If it worked I might be able to deal with it though. But.... it doesn't. This is because there might be a query (one of the 16) that doesn't pull up a value. Let's say that salesid 13312 didn't have any Classic Plus sales, which has a value of 6 in the Reg field. I need the query, or ultimately the report, to add the values that are there, and display a 0 for anything that isn't there. whew.
So it would look like:
Standard Classic ClassicPlus
14 5 0
What can I do to get this done?
What I'm needing to do is extract these values as something meaningful in a report by way of query. I need the query to find a particular number in Reg, say 7, and sum them all up. Basically 7 is the value for a sale called Standard, and 5 would be the value of Classic, etc. This is what my table looks like :
WorkOrder SalesID Reg Date
5500 13312 7 01/01/04
6600 13312 5 01/01/04
9999 55551 1 01/01/04
8800 13312 7 01/01/04
I need the query to take the 7's, and total them up in a field called SumOfStandard, and then the 5's, etc for each individual SalesID. Right now what I have is a Query with 16 nested queries in it, one to sum up each field. That's a problem itself, as far as the clutter of queries, but also I'm imagining for speed. If it worked I might be able to deal with it though. But.... it doesn't. This is because there might be a query (one of the 16) that doesn't pull up a value. Let's say that salesid 13312 didn't have any Classic Plus sales, which has a value of 6 in the Reg field. I need the query, or ultimately the report, to add the values that are there, and display a 0 for anything that isn't there. whew.
So it would look like:
Standard Classic ClassicPlus
14 5 0
What can I do to get this done?