//inserting Records insert_recordset DAK_VoucherTransactionTmpLoc(SubledgerVoucherDataAreaId, SubledgerVoucher, AccountingDate, SubledgerJournalEntry,PurchId,PurchStatus,DocumentState) select SubledgerVoucherDataAreaId, SubledgerVoucher, AccountingDate, SubledgerJournalEntry from GeneralJournalEntryLoc join subledgerVoucherGeneralJournalEntryLoc where subledgerVoucherGeneralJournalEntryLoc.GeneralJournalEntry == GeneralJournalEntryLoc.RecId join vendInvoiceJour where vendInvoiceJour.CostLedgerVoucher == subledgerVoucherGeneralJournalEntryLoc.Voucher && vendInvoiceJour.InvoiceDate == subledgerVoucherGeneralJournalEntryLoc...