> >**1st: > >SELECT DISTINCT [qry - VarCreditMarge_BE].* >FROM [qry - VarCreditMarge_BE] >WHERE [qry - VarCreditMarge_BE].vcnumca2 in > (select [qry - VarJunMarge_MatchAccount_BE].vcnumca2 from [qry - VarJunMarge_MatchAccount_BE] > where [qry - VarJunMarge_MatchAccount_BE].MatchAccount=0) > > >**second: > >SELECT DISTINCT [qry - VarCreditMarge_BE].*, [qry - VarJunMarge_MatchAccount_BE].[MatchAccount] >FROM [qry - VarCreditMarge_BE] INNER JOIN [qry - VarJunMarge_MatchAccount_BE] ON [qry - VarCreditMarge_BE].[vcnumca2]=[qry - VarJunMarge_MatchAccount_BE].[vcnumca2] >WHERE [qry - VarJunMarge_MatchAccount_BE].[MatchAccount]=0 > >My experience is that the subquery in the filter seems to run for every record in the FROM clause. You can speed things up by breaking this up into two queries--the first is the one you're running in your WHERE clause and then run the second query with an INNER JOIN to the results from the first query.
select [qry - VarJunMarge_MatchAccount_BE].vcnumca2 from [qry - VarJunMarge_MatchAccount_BE] where [qry - VarJunMarge_MatchAccount_BE].MatchAccount=0 INTO CURSOR T1 SELECT DISTINCT [qry - VarCreditMarge_BE].* FROM [qry - VarCreditMarge_BE] INNER JOIN T1 ; ON [qry - VarCreditMarge_BE].vcnumca2 = [qry - VarJunMarge_MatchAccount_BE].vcnumca2HTH