G
Guest
I have data that looks like this in a query from multiple tables. and would like to return sums of categories.
Cust number Customer Name ProdCode SalesMo1 Salesmo2 SalesMoX
123 ABC Corp 100 100 100 100
123 ABC Corp 110 0 50 50
123 ABC Corp 120 75 100 100
123 ABC Corp 200 0 0 35
123 ABC Corp 220 50 50 50
123 ABC Corp 350 0 50 50
123 ABC Corp 400 100 100 100
123 ABC Corp etc
124 B Corp 100 0 0 50
124 B Corp 130 100 100 100
etc
I would like the result to Sum Product Codes 100 to 199, 200 to 299, and 300 to 399 etc. and return something like,
123 ABC Corp 175 250 250
123 ABC Corp 50 50 85
123 ABC Corp 0 50 50
etc
124 B Corp 100 100 150
any suggestions? If I try to use multiple queries focusing on each parameter, I eliminate customers that do not have any data in a particular query (a customer that has not purchased anything from product codes 100 to 199 will not be shown in the query, and when combined, I lose that customer)
Cust number Customer Name ProdCode SalesMo1 Salesmo2 SalesMoX
123 ABC Corp 100 100 100 100
123 ABC Corp 110 0 50 50
123 ABC Corp 120 75 100 100
123 ABC Corp 200 0 0 35
123 ABC Corp 220 50 50 50
123 ABC Corp 350 0 50 50
123 ABC Corp 400 100 100 100
123 ABC Corp etc
124 B Corp 100 0 0 50
124 B Corp 130 100 100 100
etc
I would like the result to Sum Product Codes 100 to 199, 200 to 299, and 300 to 399 etc. and return something like,
123 ABC Corp 175 250 250
123 ABC Corp 50 50 85
123 ABC Corp 0 50 50
etc
124 B Corp 100 100 150
any suggestions? If I try to use multiple queries focusing on each parameter, I eliminate customers that do not have any data in a particular query (a customer that has not purchased anything from product codes 100 to 199 will not be shown in the query, and when combined, I lose that customer)