我们合并了数百个有交易的重复客户账户。例如,客户“Alexander Smith”和“Alex Smith”被合并为“Alexander Smith”。在我们的custTableMergeLog
中,我插入了与旧/新客户帐户合并的记录。
此查询应仅识别具有无效客户的 ledgerJournalTrans 记录,但我们有一条记录表明它已被合并。
当我取消注释这两行时它不起作用......有什么想法吗?
while select ledgerJournalTrans
where ledgerJournalTrans.AccountType == LedgerJournalACType::Cust
notexists join custTable
where custTable.AccountNum == ledgerJournalTrans.AccountNum
//exists join custTableMergeLog
// where custTableMergeLog.CustAccountOld == ledgerJournalTrans.AccountNum
{
select firstonly custTableMergeLog2
where custTableMergeLog2.CustAccountOld == ledgerJournalTrans.AccountNum;
info(strfmt("Account# %1, CustTable Name: %2, CustMergeLog %3", ledgerJournalTrans.AccountNum, CustTable::find(ledgerJournalTrans.AccountNum).Name, custTableMergeLog2.CustAccountOld));
i++;
if (i>10)
break;
}