Les Isaacs
Registered User.
- Local time
- Today, 06:06
- Joined
- May 6, 2008
- Messages
- 186
Hi All
I need a query that will return any records from 'qry bulletin recipients' that do NOT have an appropriate record in 'tblEmailLogs': appropriate, for this purpose, means that the field [memBody] in 'tblEmailLogs' contains the text "PayeDoc is on the move" and also that the field [dteSend] in 'tblEmailLogs' is later than 25 March 2012.
There will be many records in 'tblEmailLogs' with related records in 'qry bulletin recipients', but if there's a related record in 'tblEmailLogs' that satisfies the above 2 criteria I don't want the query to return the related record from 'qry bulletin recipients'.
My attempt was:
SELECT tblEmailLogs.memBody, tblEmailLogs.dteSend, [qry bulletin recipients].email, [qry bulletin recipients].[prac name]
FROM tblEmailLogs RIGHT JOIN [qry bulletin recipients] ON tblEmailLogs.txtEmailTo = [qry bulletin recipients].email
WHERE (((tblEmailLogs.memBody) Like "*" & "PayeDoc is on the move" & "*") AND ((tblEmailLogs.dteSend)>#3/25/2012#));
... but this does not return the required records.
Hope someone can help.
Many thanks
Les
I need a query that will return any records from 'qry bulletin recipients' that do NOT have an appropriate record in 'tblEmailLogs': appropriate, for this purpose, means that the field [memBody] in 'tblEmailLogs' contains the text "PayeDoc is on the move" and also that the field [dteSend] in 'tblEmailLogs' is later than 25 March 2012.
There will be many records in 'tblEmailLogs' with related records in 'qry bulletin recipients', but if there's a related record in 'tblEmailLogs' that satisfies the above 2 criteria I don't want the query to return the related record from 'qry bulletin recipients'.
My attempt was:
SELECT tblEmailLogs.memBody, tblEmailLogs.dteSend, [qry bulletin recipients].email, [qry bulletin recipients].[prac name]
FROM tblEmailLogs RIGHT JOIN [qry bulletin recipients] ON tblEmailLogs.txtEmailTo = [qry bulletin recipients].email
WHERE (((tblEmailLogs.memBody) Like "*" & "PayeDoc is on the move" & "*") AND ((tblEmailLogs.dteSend)>#3/25/2012#));
... but this does not return the required records.
Hope someone can help.
Many thanks
Les