A few of us have looked at this SQL that is in a module and just can't figure out where it's going wrong - we're getting loads of problems getting it to work - I've transposed it from the SQL window to the VBA window and inserted line breaks etc but think somewhere it's not worked properly!
MTIA!
MTIA!
Code:
SQLStmt = "SELECT [qryMailing - All Information].[qrymailing addresses].[People ID] AS PeopleID, qryCurrentMailing.MailingSuccessful," _
& " nz([Surname]) AS DSurname, Nz([Forename]) AS DForeName, [qryMailing - All Information].Email AS EmailAddress, Nz([Company name]) AS CompanyName, Nz([Fullname]) AS NewFullName, [qryMailing - All Information].ConventionType" _
& " FROM [qryMailing - All Information] LEFT JOIN qryCurrentMailing ON [qryMailing - All Information].[qrymailing addresses].[People ID] = qryCurrentMailing.QPeopleID" _
& " WHERE ((([qryMailing - All Information].[qrymailing addresses].[People ID])=54 Or ([qryMailing - All Information].[qrymailing addresses].[People ID])=133 Or ([qryMailing - All Information].[qrymailing addresses].[People ID])=134) " _
& " AND ((qryCurrentMailing.MailingSuccessful)=No Or (qryCurrentMailing.MailingSuccessful) Is Null) AND (([qryMailing - All Information].Email) Is Not Null)"