Access Append Querry

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Trying to Append records from One table into another.
Merging 56 records into a table with 41 records, and it says it is about to
create 2296 recorde. (Happens to be 56*41)

These are conversions from Excel. I've manipulated then so that they are
tables in the same DB, fields are named the same as the target field, data
types match, etc.
It automatically populates the Append From row on the build process. But
when I click the "!" it warns me that it is about to append all these records.

Any idea what I'm doing wrong?
 
What's the SQL of your query? (If you're not familiar with working with the
SQL generated by Access, open the query in Design View, then select SQL View
from the View menu)
 
INSERT INTO Sheet1 ( TAB, Agency, [Street Address], City, [Billing #], [DSL
IP], Gateway, Network, Management, Serial, Tag, Contact, [Contact Phone #],
[DSL #], [PPPoE Username], [PPoE Password], Comment )
SELECT Sheet2.TAB, Sheet2.Agency, Sheet2.[Street Address], Sheet2.City,
Sheet2.[Billing #], Sheet2.[DSL IP], Sheet2.Gateway, Sheet2.Network,
Sheet2.Management, Sheet2.Serial, Sheet2.Tag, Sheet2.Contact, Sheet2.[Contact
Phone #], Sheet2.[DSL #], Sheet2.[PPPoE Username], Sheet2.[PPPoE Password],
Sheet2.Comment
FROM Sheet2, Sheet1;
 
You've got what's referred to as a Cartesian Product. You're not providing
any way to indicate which record(s) in the first table are related to which
record(s) in the second table.

What exactly are you trying to do? Add the 56 records from Sheet2 to the 41
records in Sheet1? Just remove the , Sheet1 from the end of your SQL

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


StephenLegh said:
INSERT INTO Sheet1 ( TAB, Agency, [Street Address], City, [Billing #],
[DSL
IP], Gateway, Network, Management, Serial, Tag, Contact, [Contact Phone
#],
[DSL #], [PPPoE Username], [PPoE Password], Comment )
SELECT Sheet2.TAB, Sheet2.Agency, Sheet2.[Street Address], Sheet2.City,
Sheet2.[Billing #], Sheet2.[DSL IP], Sheet2.Gateway, Sheet2.Network,
Sheet2.Management, Sheet2.Serial, Sheet2.Tag, Sheet2.Contact,
Sheet2.[Contact
Phone #], Sheet2.[DSL #], Sheet2.[PPPoE Username], Sheet2.[PPPoE
Password],
Sheet2.Comment
FROM Sheet2, Sheet1;


Douglas J. Steele said:
What's the SQL of your query? (If you're not familiar with working with
the
SQL generated by Access, open the query in Design View, then select SQL
View
from the View menu)
 
Back
Top