S
ScottH
I have a database where I regularly import refreshed tables. The tables
show employees whose records have been rejected in a sync run between
SAP and a mainframe.
Some of these employee records are not worth fixing... ie, employees
who have left the company. As a result, I am creating an "exclusion"
table that will contain the records that should be ignored.
When the fresh rejection tables are loaded, I need to query the fresh
data and remove the rows that exactly match a row in the exclusion
table.
I need some help with the query, however, because it is having troubles
when I try to match null values. I've started with a select query,
trying to get the format right before moving on to any deleting. Here
is the SQL I'm currently using:
SELECT DISTINCT tblAllDataMerged.*
FROM tblExcludedRecords
INNER JOIN tblAllDataMerged
ON (tblExcludedRecords.[GEMS Lastname] = tblAllDataMerged.[GEMS
Lastname]) AND (tblExcludedRecords.SSN = tblAllDataMerged.SSN);
SSN (Social Security Number) is always populated, but Lastname is
frequently null. The query omits all of the rows that have a null value
in the joined fields.
Can someone help me understand what I need to do to get this to work?
Thanks!
Scott
show employees whose records have been rejected in a sync run between
SAP and a mainframe.
Some of these employee records are not worth fixing... ie, employees
who have left the company. As a result, I am creating an "exclusion"
table that will contain the records that should be ignored.
When the fresh rejection tables are loaded, I need to query the fresh
data and remove the rows that exactly match a row in the exclusion
table.
I need some help with the query, however, because it is having troubles
when I try to match null values. I've started with a select query,
trying to get the format right before moving on to any deleting. Here
is the SQL I'm currently using:
SELECT DISTINCT tblAllDataMerged.*
FROM tblExcludedRecords
INNER JOIN tblAllDataMerged
ON (tblExcludedRecords.[GEMS Lastname] = tblAllDataMerged.[GEMS
Lastname]) AND (tblExcludedRecords.SSN = tblAllDataMerged.SSN);
SSN (Social Security Number) is always populated, but Lastname is
frequently null. The query omits all of the rows that have a null value
in the joined fields.
Can someone help me understand what I need to do to get this to work?
Thanks!
Scott