I have a result set that contains data that should be included in the matching result set vs exception. It is not pulling anything vs. the table it is being compared to. I finally have the record count right but the data is wrong.
This needs to be written as simply as possible as there will be no IT support in the future.
SELECT DISTINCT Peoplesoft_ADAC_Globe_0941.Unit, [Balance sheet mapping 0941].Unit, Peoplesoft_ADAC_Globe_0941.SubAcc, [Balance sheet mapping 0941].SubAcc, Peoplesoft_ADAC_Globe_0941.Acct, [Balance sheet mapping 0941].Acct, Peoplesoft_ADAC_Globe_0941.Descr, Peoplesoft_ADAC_Globe_0941.[Account Type], Peoplesoft_ADAC_Globe_0941.DeptID, [Balance sheet mapping 0941].DeptID, Peoplesoft_ADAC_Globe_0941.Affl, Peoplesoft_ADAC_Globe_0941.Intercompany, Peoplesoft_ADAC_Globe_0941.[Base Curr], Peoplesoft_ADAC_Globe_0941.[Sum Amount], Peoplesoft_ADAC_Globe_0941.Owner, Peoplesoft_ADAC_Globe_0941.Department, Peoplesoft_ADAC_Globe_0941.Level
FROM Peoplesoft_ADAC_Globe_0941 LEFT JOIN [Balance sheet mapping 0941] ON (Peoplesoft_ADAC_Globe_0941.DeptID = [Balance sheet mapping 0941].DeptID) AND (Peoplesoft_ADAC_Globe_0941.Unit = [Balance sheet mapping 0941].Unit) AND (Peoplesoft_ADAC_Globe_0941.SubAcc = [Balance sheet mapping 0941].SubAcc) AND (Peoplesoft_ADAC_Globe_0941.Acct = [Balance sheet mapping 0941].Acct)
WHERE ((([Balance sheet mapping 0941].Acct) Is Null)) OR ((([Balance sheet mapping 0941].SubAcc) Is Null)) OR ((([Balance sheet mapping 0941].Unit) Is Null)) OR ((([Balance sheet mapping 0941].DeptID) Is Null));
This needs to be written as simply as possible as there will be no IT support in the future.
SELECT DISTINCT Peoplesoft_ADAC_Globe_0941.Unit, [Balance sheet mapping 0941].Unit, Peoplesoft_ADAC_Globe_0941.SubAcc, [Balance sheet mapping 0941].SubAcc, Peoplesoft_ADAC_Globe_0941.Acct, [Balance sheet mapping 0941].Acct, Peoplesoft_ADAC_Globe_0941.Descr, Peoplesoft_ADAC_Globe_0941.[Account Type], Peoplesoft_ADAC_Globe_0941.DeptID, [Balance sheet mapping 0941].DeptID, Peoplesoft_ADAC_Globe_0941.Affl, Peoplesoft_ADAC_Globe_0941.Intercompany, Peoplesoft_ADAC_Globe_0941.[Base Curr], Peoplesoft_ADAC_Globe_0941.[Sum Amount], Peoplesoft_ADAC_Globe_0941.Owner, Peoplesoft_ADAC_Globe_0941.Department, Peoplesoft_ADAC_Globe_0941.Level
FROM Peoplesoft_ADAC_Globe_0941 LEFT JOIN [Balance sheet mapping 0941] ON (Peoplesoft_ADAC_Globe_0941.DeptID = [Balance sheet mapping 0941].DeptID) AND (Peoplesoft_ADAC_Globe_0941.Unit = [Balance sheet mapping 0941].Unit) AND (Peoplesoft_ADAC_Globe_0941.SubAcc = [Balance sheet mapping 0941].SubAcc) AND (Peoplesoft_ADAC_Globe_0941.Acct = [Balance sheet mapping 0941].Acct)
WHERE ((([Balance sheet mapping 0941].Acct) Is Null)) OR ((([Balance sheet mapping 0941].SubAcc) Is Null)) OR ((([Balance sheet mapping 0941].Unit) Is Null)) OR ((([Balance sheet mapping 0941].DeptID) Is Null));