473,385 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Duplicate Output Destination Error (Aliasing a Query Field)

Folks,
I have two tables, [LB Acquistion Data] and [LB Analysis Data], both
containing a field with the same name, [LB Acquistion Data Key]. This
field defines the primary/foreign key relationship between the two
tables. It's the primary key for [LB Acquistion Data].

I am trying to insert a record in the [LB Analysis Data] table but
Access is fussing because the field names are the same.

How does one alias a field in the query?

INSERT INTO [LB Analysis Data] ( [LB Acquistion Data Key], Comments,
[LB Acquistion Data Key] )
SELECT [LB Acquistion Data].[LB Acquistion Data Key], [LB Acquistion
Data].Comments, [LB Analysis Data].[LB Acquistion Data Key]
FROM [LB Acquistion Data] INNER JOIN [LB Analysis Data] ON [LB
Acquistion Data].[LB Acquistion Data Key] = [LB Analysis Data].[LB
Acquistion Data Key]
WHERE ((([LB Acquistion Data].Comments)="test"));

Thanks,
Vint

Sep 28 '06 #1
1 8918
You cannot use the same field ([LB Acquistion Data Key]) twice in your
Insert Into statement. You need to use separate queries.

Hope that helps!
v.*****@comcast.net wrote:
Folks,
I have two tables, [LB Acquistion Data] and [LB Analysis Data], both
containing a field with the same name, [LB Acquistion Data Key]. This
field defines the primary/foreign key relationship between the two
tables. It's the primary key for [LB Acquistion Data].

I am trying to insert a record in the [LB Analysis Data] table but
Access is fussing because the field names are the same.

How does one alias a field in the query?

INSERT INTO [LB Analysis Data] ( [LB Acquistion Data Key], Comments,
[LB Acquistion Data Key] )
SELECT [LB Acquistion Data].[LB Acquistion Data Key], [LB Acquistion
Data].Comments, [LB Analysis Data].[LB Acquistion Data Key]
FROM [LB Acquistion Data] INNER JOIN [LB Analysis Data] ON [LB
Acquistion Data].[LB Acquistion Data Key] = [LB Analysis Data].[LB
Acquistion Data Key]
WHERE ((([LB Acquistion Data].Comments)="test"));

Thanks,
Vint
Sep 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Dalan | last post by:
Please help - just take a quick look at the function code below. It probably just needs some minor tweaking. The function module is based on an intermediate query to provide a group record...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
8
by: Iona | last post by:
Hi Allan, I'm using a nifty piece of code you put on here some time back to do a duplicate entry check as below. I'm using to check for duplicate names. However I am getting an error message on...
2
by: Tom Baxter | last post by:
I have a numeric column in a query called Prov1.Volume. When I try taking the sum of that column (using SUM aggregate function in Design View) it gives a syntax error. It says that...
2
by: mivey4 | last post by:
Okay I have 2 tables: Table A - holds a list of new hardware serial numbers and their corresponding model (no constraints or indexes) Table B - holds a distinct list of current serial numbers...
1
by: gelpaks | last post by:
My problem is a bit long and involved, but I will try to summarize. I have created a database using Access 2000 for a cemetery and it now is populated with almost 6,000 names. I created a form so...
5
by: jaishu | last post by:
Hi , I am using a form based on a query. The form is locked and the fields are not editable, but when i just tried typing something, the contents on the form didnt change, but when i closed and...
2
MindBender77
by: MindBender77 | last post by:
Hello all, I get an error when trying to run an append query that states duplicate output to a field name. I think because I'm trying to append records to a table that is already in the use. Below...
1
by: VinArt | last post by:
MS Acc 2003, XP Thank you in advance for any help. I have tables called "Makeup" and "Lines". Each makeup can have multiple lines. Goal is to create a new "makeup" with identical "lines"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.