Are the two queries doing the same thing?

M

Mark

Hi All,

I have an issue with a query running long (Fig 1). Is Fig 2 doing the same
thing? It runs much faster, but just wanted to make sure it is doing the
same thing. Thanks!

Fig 1
select AudID
FROM LateErrorHistory2
WHERE (LateErrorHistory2.AudID Not In (select distinct AudID from
TblEmployeeAudit where AudID <> NULL));

Fig 2
SELECT AudID
FROM LateErrorHistory2 LEFT JOIN TblEmployeeAudit ON LateErrorHistory2.AudID
= TblEmployeeAudit.AudID
WHERE (((TblEmployeeAudit.AudID) Is Null));
 
M

Mark

Sorry, copied the same query. Here it is....

Hi All,

I have an issue with a query running long (Fig 1). Is Fig 2 doing the same
thing? It runs much faster, but just wanted to make sure it is doing the
same thing. Thanks!

Fig 1
select AudID
FROM LateErrorHistory2
WHERE (LateErrorHistory2.AudID Not In (select distinct AudID from
TblEmployeeAudit where AudID <> NULL));

Fig 2
SELECT AudID
FROM LateErrorHistory2 LEFT JOIN TblEmployeeAudit ON LateErrorHistory2.AudID
= TblEmployeeAudit.AudID
WHERE (((TblEmployeeAudit.AudID) Is Null));
 
J

Jerry Whittle

1. Do they return the same number of records?

2. If 1 is true, do they return the same records?
 
J

John Spencer

They should be returning identical results.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top