By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,934 Members | 1,352 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,934 IT Pros & Developers. It's quick & easy.

Duplicate Output Destination Error (Aliasing a Query Field)

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.