lartigue64
Technical User
I'm working with a table of sales, and I'm trying to come up with a way of populating a second table that I will use to report the statistics. ie, the number of sales by area and type for a specific month, quarter or year.
I'm trying to build a query that will fill the statistics table, but haven't found one that works.
For example I want to see the following in the table_Stats:
area1 timeperiod_x year_y type_t number_z
area1 timeperiod_x year_y type_u number_aa
...
The following query is what i want to do, but run in the query window of Access returns the error "Reserved error (-3025); There is no message for this error.
INSERT INTO table_stats
VALUES ('AREA1','January', 2007,'typeA',
(SELECT Count(ID) FROM table1 WHERE [Area]='AREA1' AND [SalesDate]>=#1/01/2007# AND [SalesDate]<=#1/31/2007# AND [Type]='in'))
thank for your help.
I'm trying to build a query that will fill the statistics table, but haven't found one that works.
For example I want to see the following in the table_Stats:
area1 timeperiod_x year_y type_t number_z
area1 timeperiod_x year_y type_u number_aa
...
The following query is what i want to do, but run in the query window of Access returns the error "Reserved error (-3025); There is no message for this error.
INSERT INTO table_stats
VALUES ('AREA1','January', 2007,'typeA',
(SELECT Count(ID) FROM table1 WHERE [Area]='AREA1' AND [SalesDate]>=#1/01/2007# AND [SalesDate]<=#1/31/2007# AND [Type]='in'))
thank for your help.