Deduplication Query help

Haha sounds like far too much effort!


This still asks for parameter value for qryImportantEmails.MinofFile

My qryDuplicateEmails SQL:
SELECT kst_tbl.*
FROM kst_tbl INNER JOIN qryImportantEmails ON
(kst_tbl.From=qryImportantEmails.From) AND
(kst_tbl.Subject=qryImportantEmails.Subject) AND
(kst_tbl.Sent=qryImportantEmails.Sent)
WHERE (((qryImportantEmails.MinOfFile)<>[kst_tbl].[File]));


My qryImportantEmails SQL:
SELECT Min(tblFilePriority.FilePriority) AS MinOfFilePriority, kst_tbl.From, kst_tbl.Subject, kst_tbl.Sent
FROM kst_tbl INNER JOIN tblFilePriority ON kst_tbl.File = tblFilePriority.FileName
GROUP BY kst_tbl.From, kst_tbl.Subject, kst_tbl.Sent;
 
Last edited:
1. So I changed the name of [FileName] in my Lookup Table to [File] to avoid confusion

2. When I run my qryImportantEmails the [MinOfFilePriority] fields returns a number instead of the file name. Is this correct? Is this what is confusing the line of the qryDuplicateEmails below?
WHERE (((qryImportantEmails.MinOfFile)<>[kst_tbl].[File]));
 
Ok


My queries appear to work as before now.

qryImporantEmails:
SELECT Min(tblFilePriority.File) AS MinOfFile, kst_tbl.From, kst_tbl.Subject, kst_tbl.Sent
FROM kst_tbl INNER JOIN tblFilePriority ON kst_tbl.File=tblFilePriority.File
GROUP BY kst_tbl.From, kst_tbl.Subject, kst_tbl.Sent;

qryDeleteEmails:
SELECT kst_tbl.*
FROM kst_tbl INNER JOIN qryImportantEmails ON (kst_tbl.Sent = qryImportantEmails.Sent) AND (kst_tbl.Subject = qryImportantEmails.Subject) AND (kst_tbl.From = qryImportantEmails.From)
WHERE (((qryImportantEmails.MinofFile)<>[kst_tbl].[File]));

I have around 100 duplicates still in my table. Any glaring errors?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom