Help with SQL

C

CDM

I import an XLS spreadsheet into an Access table every morning. The new
table lists all of our customers with the date and amount of their last
payment. I've written a routine that adds new pmts for each customer to a
PmtHistory table using code that basically works like this:
For each row in tblXLS
Open a recordset in PmtHistory looking for tblXLS.Customer_Id and
tblXLS.PmtDate
If .eof then: Add a new record
Next

I'm wondering if there is an SQL statement that could do this faster?
 
B

bhicks11 via AccessMonster.com

Link the tblXLS with PmtHistory in a query on CustomerID and PmtDate. Put
NULL in .CustomerID to filter the records that are not already in the
PmtHistory table. Make it an APPEND query - set PmtHistory as the table to
append to. This works, I just tried it. Post back if you need any help
with it.

Bonnie
http://www.dataplus-svc.com
 

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