Good Morning,
I have 2 queries serving useful routines, one to filter out duplicate addresses for a mailing label routine, the second to convert tick boxes into Y/N answers for a Tab Delimited Text file export.
My question is; can I combine the 2 SQL statements in the 2nd query without amending them in any way.
The SQL statements are;
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-News List], a.[e-Mail List], CStr([a].[Member ID])+[a].[Address 1]
HAVING (((a.[e-News List])=False) 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])));
******************************************
SELECT [Mail List].[E-Mail], [Mail List].[First Name], [Mail List].Surname, IIf([e-News List],"Y","N") AS ENewsYN, IIf([SO],"Y","N") AS SOYN, IIf([Leader of Groups],"Y","N") AS LeaderYN, IIf([Committee],"Y","N") AS CommitteeYN
FROM [Mail List]
WHERE ((([Mail List].[E-Mail]) Is Not Null))
ORDER BY [Mail List].Surname;
******************************************
Regards,
jcbhydro
I have 2 queries serving useful routines, one to filter out duplicate addresses for a mailing label routine, the second to convert tick boxes into Y/N answers for a Tab Delimited Text file export.
My question is; can I combine the 2 SQL statements in the 2nd query without amending them in any way.
The SQL statements are;
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-News List], a.[e-Mail List], CStr([a].[Member ID])+[a].[Address 1]
HAVING (((a.[e-News List])=False) 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])));
******************************************
SELECT [Mail List].[E-Mail], [Mail List].[First Name], [Mail List].Surname, IIf([e-News List],"Y","N") AS ENewsYN, IIf([SO],"Y","N") AS SOYN, IIf([Leader of Groups],"Y","N") AS LeaderYN, IIf([Committee],"Y","N") AS CommitteeYN
FROM [Mail List]
WHERE ((([Mail List].[E-Mail]) Is Not Null))
ORDER BY [Mail List].Surname;
******************************************
Regards,
jcbhydro