Hi,
I have several query tables, one for each office sales:
e.g.
1. New York
Timestamp - office - product code - sales amount
29/09/2012 - newy york - ab100 - 100 USD
29/09/2012 - new york - ab200 - 120 USD
28/09/2012 - new york - ab100 - 100 USD
2. Atlanta
Timestamp - office - product code - sales amount
29/09/2012 - atlanta - ab100 - 100 USD
29/09/2012 - atlanta - ab200 - 120 USD
28/09/2012 - atlanta - ab100 - 100 USD
QUESTION:
I need to get a table to sum all sales of all offices on a daily base:
Timestamp - office - product code - sales amount
29/09/2012 - sum of all - ab100 - 200 (100+100) USD
29/09/2012 - sum of all - ab200 - 240 (120+120) USD
28/09/2012 - sum of all - ab100 - 200 (100+100) USD
I can not combine them in one table because of size limits.. each query table is approaching 500k rows. Can I have a query table that holds only the day totals for each product?
Thanks
PS
I extract the query tables from several tables with the following code:
SELECT
"ActivityDt","BarcodNumber","LocationName1","SalesFees"
FROM "Customers1"
WHERE "LocationName" = 'xxx'
UNION ALL
SELECT
"ActivityDt","BarcodNumber","LocationName1","SalesFees"
FROM "Customers2"
WHERE "LocationName" = 'xxx'
Maybe I could extract the totals directly from the tables instead of going trough the query tables?
DATA TABLES --> QUERY TABLES --> TOTALS QUERY TABLE
vs.
DATA TABLES --> TOTALS QUERY TABLE