U
User 2084
Hi All,
I'm teaching myself the basics of database design using Microsoft
Access. I have a query that is really slow for large data sets. I was
hoping someone might be able to offer a suggestion or two on whether
or not there are any alternatives to what I'm doing.
The query that's slow uses the 'Not In' clause. Here's the SQL:
SELECT Cars.*, *
FROM FastCarsEnteringDealership INNER JOIN Cars ON
FastCarsEnteringDealership.VIN = Cars.VIN
WHERE ((([FastCarsEnteringDealership].[Cars].[VIN]) Not In (select VIN
from CarsAlreadySold)) AND
(([FastCarsEnteringDealership].[Cars].[VIN]) Not In (select VIN from
CarsTransferredOffLot)) AND
(((FastCarsEnteringDealership.time_stamp)<[Enter Date:] Or
(FastCarsEnteringDealership.time_stamp) Like [Enter Date:] & "*")));
Are there faster alternatives to using Not In, and if so, what are
they?
Thanks in advance.
I'm teaching myself the basics of database design using Microsoft
Access. I have a query that is really slow for large data sets. I was
hoping someone might be able to offer a suggestion or two on whether
or not there are any alternatives to what I'm doing.
The query that's slow uses the 'Not In' clause. Here's the SQL:
SELECT Cars.*, *
FROM FastCarsEnteringDealership INNER JOIN Cars ON
FastCarsEnteringDealership.VIN = Cars.VIN
WHERE ((([FastCarsEnteringDealership].[Cars].[VIN]) Not In (select VIN
from CarsAlreadySold)) AND
(([FastCarsEnteringDealership].[Cars].[VIN]) Not In (select VIN from
CarsTransferredOffLot)) AND
(((FastCarsEnteringDealership.time_stamp)<[Enter Date:] Or
(FastCarsEnteringDealership.time_stamp) Like [Enter Date:] & "*")));
Are there faster alternatives to using Not In, and if so, what are
they?
Thanks in advance.