wvanjaarsveld
New member
- Local time
- Today, 10:38
- Joined
- May 14, 2007
- Messages
- 5
I have a query in ms access. (It is used to simulate inventories under (s,q) policies(not really important)).
It is used on a big table(1.000.000 entries), with data on ship dates and quantities of about 70.000 parts. It adds to the 4 columns one extra columns, with the usage in the leadtime prior to the ship date of the specific part number. It works, but it is too slow. I can only run it within 10 minutes if I leave a number of parts out of the table simulatie. Does anyone have an idea how to optimize it, so that I can include all parts?
sql:
SELECT simulatie.product_nr, simulatie.date, simulatie.customer, simulatie.usage, Sum(simulatie_1.usage) AS usagetotal
FROM simulatie AS simulatie_1 INNER JOIN simulatie ON simulatie_1.produkt_nr = simulatie.produkt_nr
WHERE (((simulatie_1.date) Between [simulatie].[date]-[simulatie].[leadtime] And [simulatie].[date]))
GROUP BY simulatie.produkt_nr, simulatie.date, simulatie.customer, simulatie.usage;
Note that the query works only on a single table.
Any help would be appreciated!
ps. version:Ms access 2002
It is used on a big table(1.000.000 entries), with data on ship dates and quantities of about 70.000 parts. It adds to the 4 columns one extra columns, with the usage in the leadtime prior to the ship date of the specific part number. It works, but it is too slow. I can only run it within 10 minutes if I leave a number of parts out of the table simulatie. Does anyone have an idea how to optimize it, so that I can include all parts?
sql:
SELECT simulatie.product_nr, simulatie.date, simulatie.customer, simulatie.usage, Sum(simulatie_1.usage) AS usagetotal
FROM simulatie AS simulatie_1 INNER JOIN simulatie ON simulatie_1.produkt_nr = simulatie.produkt_nr
WHERE (((simulatie_1.date) Between [simulatie].[date]-[simulatie].[leadtime] And [simulatie].[date]))
GROUP BY simulatie.produkt_nr, simulatie.date, simulatie.customer, simulatie.usage;
Note that the query works only on a single table.
Any help would be appreciated!
ps. version:Ms access 2002