INSERT INTO ACEINVOICES ( YYYYMM, District, SRSA_Nbr, Category, TaskNbr, StartDate, EndDate, BillingType, [Transaction], UOM, Quantity, Rate, INVExtAmount, INVTax, INVTotalAmount, ItemNbr, ProductGroup, CustomerNbr, CustomerName, LegacyCustNbr, City, State, ZIP, CustAcctNbr, INV_CM, INV_CM_DATE, TrxType, ServiceType, NatLocal, RunDate, NatAcctNo )
SELECT [Enter YYYYMM] AS YYYYMM, SGXSR019M.District, SANbr([SR_SA_Number]) AS SA, SGXSR019M.Category, SGXSR019M.Task_Number, SGXSR019M.Start_Date, SGXSR019M.End_date, SGXSR019M.Billing_Type, SGXSR019M.Transaction_Name, SGXSR019M.UOM, SGXSR019M.QTY, SGXSR019M.Rate, SGXSR019M.INV_Ext_Amt, SGXSR019M.TAX, SGXSR019M.Total_Amt, SGXSR019M.Item_Number, SGXSR019M.Product_Group, CustNbr([Customer_Number]) AS Expr1, SGXSR019M.Customer_Name, SGXSR019M.Legacy_Customer, SGXSR019M.City, SGXSR019M.State, SGXSR019M.ZIP, SGXSR019M.Cust_Acct_Number, SGXSR019M.[INV_CM#], SGXSR019M.INV_CM_DATE, SGXSR019M.Trx_Type, SGXSR019M.Service_Type, Left([Natl_Local],1) AS Expr2, SGXSR019M.runDate, SGXSR019M.natAcctNo
FROM SGXSR019M
WHERE (((SGXSR019M.Category)<>"Service Agreement" And Not (SGXSR019M.Category) Is Null));