...
SELECT DISTINCT [GL Acct] FROM [CMC-IOWA].dbo.APBegBalance a
LEFT JOIN ERP_Iowa_Staging.dbo.GLAccountConversion g
ON g.OldGLAccount = a.[GL Acct]
WHERE g.GLAccountConversionID IS NULLEmail list to amy
INSERT INTO APVoucherImportDetail
(InvoiceNumber,
Amount,
Units,
InvoiceDate,
ReceivedDate,
GLAccount,
DivisionCode,
VendorCode,
InvoiceComment,
DueDate,
ExpenseComment,
DiscountAmount,
APVoucherImportStatusID,
CreateDate)
SELECT a.Invoice,
CAST (LTRIM(RTRIM(REPLACE(a.Amount,',',''))) AS DECIMAL(16,5)),
CAST (LTRIM(RTRIM(REPLACE(a.Units,',',''))) AS DECIMAL(16,5)),
CAST (a.InvDte AS DATETIME),
CAST (a.RcvDte AS DATETIME),
g.NewGLAccount,
a.Division,
v.NewVendorCode,
a.[Inv Comment],
CAST (a.DueDte AS DATETIME),
a.[Exp Comment],
CAST (LTRIM(RTRIM(REPLACE(a.[Disc Amount],',',''))) AS DECIMAL(16,5)),
CAST (a.[Status] AS INT),
CAST (a.[Create Dte] AS DATETIME)
FROM [CMC-Iowa].[dbo].[APBegBalance] a
INNER JOIN GLAccountConversion g
ON g.OldGLAccount = a.[GL Acct]
INNER JOIN VendorConversion v
ON v.OldVendorCode = a.Vendor
Run Import Vouchers program under ERP Payables > Utilities.
...