Adding Records to a table with append query

W

wesley.allen

Hello all.

I am trying to build an append query to add a certain number of
records to a table based on a number I enter into another table.

Detail:

I have a table that will track loan information "DebtMain". In this
table, I have a field called "Number of Payments". I want to have a
query that will add the number of records corresponding to "Number of
Payments" into another table, "DebtPayments".

I appreciate any help. Thanks
 
G

Guest

Create a table named CountNumber with number field named CountNUM having
numbers from 1 to your maximum. Then use the following query edited for your
table names and fields as necessary.
INSERT INTO DebtPayments ( AccountID, AccountName, ParentAccountID, [Payment
Number] )
SELECT Account.AccountID, Account.AccountName, Account.ParentAccountID,
CountNumber.CountNUM AS [Payment Number]
FROM CountNumber, Account INNER JOIN DebtMain ON Account.AccountID =
DebtMain.AccountID
WHERE (((CountNumber.CountNUM)<=[Number of Payments] And
(CountNumber.CountNUM)>0))
ORDER BY Account.AccountID, Account.AccountName, CountNumber.CountNUM;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top