M
meghanwh
I have a query that has 6 criteria (No mail AND group=10, no mail AND
young society=true, etc.). If someone meets more than 1 criteria, they
are listed twice. How do I eliminate this? I've just been creating the
query in design view, so I have the AND statements on the same line
and the OR statements on separate lines. Here's the SQL:
SELECT DISTINCT [New People Query].UID, [New People Query].[No Mail],
[New People Query].PRFX, [New People Query].[F-NAME], [New People
Query].[M-NAME], [New People Query].[L-NAME], PplACS.[Alumni Code],
[New People Query].[Young Society], [New People Query].Ranking, [New
People Query].Pref1, [New People Query].Pref2, [New People
Query].PrefStrt, [New People Query].PrefCity, [New People
Query].PrefState, [New People Query].PrefZip
FROM PplACS INNER JOIN [New People Query] ON PplACS.UID = [New People
Query].UID
WHERE ((([New People Query].[No Mail])=False) AND ((PplACS.[Alumni
Code])="10")) OR ((([New People Query].[No Mail])=False) AND (([New
People Query].[Young Society])=True)) OR ((([New People Query].[No
Mail])=False) AND (([New People Query].Ranking)="1" Or ([New People
Query].Ranking)="2" Or ([New People Query].Ranking)="3" Or ([New
People Query].Ranking)="$50M+" Or ([New People Query].Ranking)="$100M
+"));
Thanks.
young society=true, etc.). If someone meets more than 1 criteria, they
are listed twice. How do I eliminate this? I've just been creating the
query in design view, so I have the AND statements on the same line
and the OR statements on separate lines. Here's the SQL:
SELECT DISTINCT [New People Query].UID, [New People Query].[No Mail],
[New People Query].PRFX, [New People Query].[F-NAME], [New People
Query].[M-NAME], [New People Query].[L-NAME], PplACS.[Alumni Code],
[New People Query].[Young Society], [New People Query].Ranking, [New
People Query].Pref1, [New People Query].Pref2, [New People
Query].PrefStrt, [New People Query].PrefCity, [New People
Query].PrefState, [New People Query].PrefZip
FROM PplACS INNER JOIN [New People Query] ON PplACS.UID = [New People
Query].UID
WHERE ((([New People Query].[No Mail])=False) AND ((PplACS.[Alumni
Code])="10")) OR ((([New People Query].[No Mail])=False) AND (([New
People Query].[Young Society])=True)) OR ((([New People Query].[No
Mail])=False) AND (([New People Query].Ranking)="1" Or ([New People
Query].Ranking)="2" Or ([New People Query].Ranking)="3" Or ([New
People Query].Ranking)="$50M+" Or ([New People Query].Ranking)="$100M
+"));
Thanks.