Eliminating entries for Duplicate addresses

jcbhydro

Registered User.
Local time
Today, 03:44
Joined
Jul 26, 2013
Messages
187
Hi Folks,

With the help of this forum I have produced a label printing query which eliminates duplicate addresses from a mail list. It works beautifully.
However, when I try to replicate with a different field criteria the new query fails to produce any output at all.

The SQL code I am using is as follows:

SELECT a.[Member ID], a.[Address 1], a.[Member Name], a.[Address 2], a.Town, a.PostCode, a.[e-Mail List]
FROM [Mail List] AS a
GROUP BY a.[Member ID], a.[Address 1], a.[Member Name], a.[Address 2], a.Town, a.PostCode, a.[e-Mail List], CStr([a].[Member ID])+[a].[Address 1]
HAVING (((a.[e-Mail List]) Is Null) AND ((CStr([a].[Member ID])+[a].[Address 1])=(Select cStr(Min(b.[Member ID])) + b.[Address 1]
From [Mail List] as b
Where b.[Address 1] = a.[Address 1]
Group By [Address 1])));

The working version has 'HAVING' e-Mail News =False instead of e-Mail List is Null. The former searches for an empty check box and the latter for an empty field.

I can't see why it doesn't work and would welcome any suggestions.

Regards,

jcbhydro
 
After further examination of my SQL code, I realize that I was incorrectly defining an 'Is Null' criteria for a Yes/No field. I had intended to search for Null records in an email field.
All is now working well.

jcbhydro
 

Users who are viewing this thread

Back
Top Bottom