S
Sue Compelling
Hi
This query, which is basically returning a record set of names NOT in
another query is taking 15-30 seconds to run.
Is my structure making it so cumbersome or do I have to just put up with it?
ACCESS 2007 (DB has 7,000 records)
TIA
SELECT "0" AS CountNil, tblContacts.ContactID, tblContacts.OrgTitle,
[tblcontacts].[firstname] & " " & [tblcontacts].[lastname] AS CombName,
tblContacts.ContactStatus, tblContacts.ContactType, tblContacts.OrgType,
tblContacts.HomePhone, tblContacts.WorkPhone, tblContacts.WorkExtension,
tblContacts.MobilePhone, tblContacts.Emailname
FROM tblContacts INNER JOIN QryVolsYrsHelpingCount ON tblContacts.ContactID
= QryVolsYrsHelpingCount.ContactID
GROUP BY "0", tblContacts.ContactID, tblContacts.OrgTitle,
[tblcontacts].[firstname] & " " & [tblcontacts].[lastname],
tblContacts.ContactStatus, tblContacts.ContactType, tblContacts.OrgType,
tblContacts.HomePhone, tblContacts.WorkPhone, tblContacts.WorkExtension,
tblContacts.MobilePhone, tblContacts.Emailname
HAVING (((tblContacts.ContactID) Not In (select contactID from
[qryvolsyrshelpingcount])) AND ((tblContacts.ContactStatus)="open") AND
((tblContacts.ContactType)="volunteer" Or
(tblContacts.ContactType)="Supporter" Or (tblContacts.ContactType)="Service
Group") AND ((tblContacts.HomePhone) Is Not Null) AND
((tblContacts.Emailname) Is Null Or (tblContacts.Emailname)=" " Or
(tblContacts.Emailname)="")) OR (((tblContacts.ContactStatus)="open") AND
((tblContacts.ContactType)="volunteer" Or
(tblContacts.ContactType)="Supporter" Or (tblContacts.ContactType)="Service
Group") AND ((tblContacts.WorkPhone) Is Not Null) AND
((tblContacts.Emailname) Is Null Or (tblContacts.Emailname)=" " Or
(tblContacts.Emailname)="")) OR (((tblContacts.ContactStatus)="open") AND
((tblContacts.ContactType)="volunteer" Or
(tblContacts.ContactType)="Supporter" Or (tblContacts.ContactType)="Service
Group") AND ((tblContacts.WorkExtension) Is Not Null) AND
((tblContacts.Emailname) Is Null Or (tblContacts.Emailname)=" " Or
(tblContacts.Emailname)="")) OR (((tblContacts.ContactStatus)="open") AND
((tblContacts.ContactType)="volunteer" Or
(tblContacts.ContactType)="Supporter" Or (tblContacts.ContactType)="Service
Group") AND ((tblContacts.MobilePhone) Is Not Null) AND
((tblContacts.Emailname) Is Null Or (tblContacts.Emailname)=" " Or
(tblContacts.Emailname)=""));
an excissively
This query, which is basically returning a record set of names NOT in
another query is taking 15-30 seconds to run.
Is my structure making it so cumbersome or do I have to just put up with it?
ACCESS 2007 (DB has 7,000 records)
TIA
SELECT "0" AS CountNil, tblContacts.ContactID, tblContacts.OrgTitle,
[tblcontacts].[firstname] & " " & [tblcontacts].[lastname] AS CombName,
tblContacts.ContactStatus, tblContacts.ContactType, tblContacts.OrgType,
tblContacts.HomePhone, tblContacts.WorkPhone, tblContacts.WorkExtension,
tblContacts.MobilePhone, tblContacts.Emailname
FROM tblContacts INNER JOIN QryVolsYrsHelpingCount ON tblContacts.ContactID
= QryVolsYrsHelpingCount.ContactID
GROUP BY "0", tblContacts.ContactID, tblContacts.OrgTitle,
[tblcontacts].[firstname] & " " & [tblcontacts].[lastname],
tblContacts.ContactStatus, tblContacts.ContactType, tblContacts.OrgType,
tblContacts.HomePhone, tblContacts.WorkPhone, tblContacts.WorkExtension,
tblContacts.MobilePhone, tblContacts.Emailname
HAVING (((tblContacts.ContactID) Not In (select contactID from
[qryvolsyrshelpingcount])) AND ((tblContacts.ContactStatus)="open") AND
((tblContacts.ContactType)="volunteer" Or
(tblContacts.ContactType)="Supporter" Or (tblContacts.ContactType)="Service
Group") AND ((tblContacts.HomePhone) Is Not Null) AND
((tblContacts.Emailname) Is Null Or (tblContacts.Emailname)=" " Or
(tblContacts.Emailname)="")) OR (((tblContacts.ContactStatus)="open") AND
((tblContacts.ContactType)="volunteer" Or
(tblContacts.ContactType)="Supporter" Or (tblContacts.ContactType)="Service
Group") AND ((tblContacts.WorkPhone) Is Not Null) AND
((tblContacts.Emailname) Is Null Or (tblContacts.Emailname)=" " Or
(tblContacts.Emailname)="")) OR (((tblContacts.ContactStatus)="open") AND
((tblContacts.ContactType)="volunteer" Or
(tblContacts.ContactType)="Supporter" Or (tblContacts.ContactType)="Service
Group") AND ((tblContacts.WorkExtension) Is Not Null) AND
((tblContacts.Emailname) Is Null Or (tblContacts.Emailname)=" " Or
(tblContacts.Emailname)="")) OR (((tblContacts.ContactStatus)="open") AND
((tblContacts.ContactType)="volunteer" Or
(tblContacts.ContactType)="Supporter" Or (tblContacts.ContactType)="Service
Group") AND ((tblContacts.MobilePhone) Is Not Null) AND
((tblContacts.Emailname) Is Null Or (tblContacts.Emailname)=" " Or
(tblContacts.Emailname)=""));
an excissively