PC Review


Reply
Thread Tools Rate Thread

INSERT INTO error: "...contains the following unknown field name..

 
 
Brad Granath
Guest
Posts: n/a
 
      15th Feb 2008
I'm having trouble with a multiple INSERT statement:

INSERT INTO [Course Completion] (
[Course Completion].EID,
[Course Completion].Course,
[Course Completion].[Date Completed],
[Course Completion].[Retrain Date]
)
SELECT
[Set Imported EID].EID,
[Set Imported EID].[Course],
[Set Imported EID].[Date Completed],
[Set Imported EID].[Retrain Date]
FROM [Set Imported EID];

When I try to run it, it returns the following error:
"The INSERT INTO statement contains the following unknown field name:
'Course Completion.EID'. Make sure you have typed the name correctly and try
the operation again."

"Set Imported EID" is a query, that runs correctly, and "Course Completion"
is a table that definitely contains the column, "EID." I don't get it. This
is my first time using a multiple INSERT statement, so maybe I'm messing up
the syntax somewhere, but if I am, I don't see how. It does the same thing
if I use a single INSERT, with explicit values. I've checked the spelling
half a dozen times, and had a co-worker go over it as well.

Any help here would be hot.

Thanks,
Brad
 
Reply With Quote
 
 
 
 
J_Goddard via AccessMonster.com
Guest
Posts: n/a
 
      15th Feb 2008
Hi -

Did you try creating an append query to see if that works? You could then
paste the resulting SQL into your code.

John


Brad Granath wrote:
>I'm having trouble with a multiple INSERT statement:
>
>INSERT INTO [Course Completion] (
>[Course Completion].EID,
>[Course Completion].Course,
>[Course Completion].[Date Completed],
>[Course Completion].[Retrain Date]
>)
>SELECT
>[Set Imported EID].EID,
>[Set Imported EID].[Course],
>[Set Imported EID].[Date Completed],
>[Set Imported EID].[Retrain Date]
>FROM [Set Imported EID];
>
>When I try to run it, it returns the following error:
>"The INSERT INTO statement contains the following unknown field name:
>'Course Completion.EID'. Make sure you have typed the name correctly and try
>the operation again."
>
>"Set Imported EID" is a query, that runs correctly, and "Course Completion"
>is a table that definitely contains the column, "EID." I don't get it. This
>is my first time using a multiple INSERT statement, so maybe I'm messing up
>the syntax somewhere, but if I am, I don't see how. It does the same thing
>if I use a single INSERT, with explicit values. I've checked the spelling
>half a dozen times, and had a co-worker go over it as well.
>
>Any help here would be hot.
>
>Thanks,
>Brad


--
John Goddard
Ottawa, ON Canada
jrgoddard at cyberus dot ca

Message posted via http://www.accessmonster.com

 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      15th Feb 2008
On Fri, 15 Feb 2008 09:50:01 -0800, Brad Granath
<(E-Mail Removed)> wrote:

>I'm having trouble with a multiple INSERT statement:
>
>INSERT INTO [Course Completion] (
>[Course Completion].EID,
>[Course Completion].Course,
>[Course Completion].[Date Completed],
>[Course Completion].[Retrain Date]
>)
>SELECT
>[Set Imported EID].EID,
>[Set Imported EID].[Course],
>[Set Imported EID].[Date Completed],
>[Set Imported EID].[Retrain Date]
>FROM [Set Imported EID];
>
>When I try to run it, it returns the following error:
>"The INSERT INTO statement contains the following unknown field name:
>'Course Completion.EID'. Make sure you have typed the name correctly and try
>the operation again."


Try just leaving off the tablename in the insertion fields:

INSERT INTO [Course Completion] (EID,Course,[Date Completed],[Retrain Date])
SELECT ...

The table name certainly isn't *needed* - you can only insert into fields in
the target table anyway.
--
John W. Vinson [MVP]
 
Reply With Quote
 
Brad Granath
Guest
Posts: n/a
 
      15th Feb 2008
Thanks.

I guess it didn't like the fact that I was specifying the columns like:

INSERT INTO tablename (tablename.columnname, tab...

Instead it wanted:

INSERT INTO tablename (columnname, col...
 
Reply With Quote
 
Brad Granath
Guest
Posts: n/a
 
      15th Feb 2008
Yep, that did it. Thanks for the help, guys.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Could somebody please explain to me what the following error in event viewer means? Event ID 7000, The Active Common Service service failed to start due to the following error: Bill.Canfield@gmail.com Windows XP General 5 21st Jan 2007 06:06 AM
Intel following AMD following Alpha Yousuf Khan Processors 0 24th Dec 2005 11:45 PM
strange error message following INSERT INTO statement Loane Sharp Microsoft Excel Programming 5 27th Aug 2004 08:27 AM
RE: The Web server reported the following error when attempting to create or open the Web project located at the following URL: <URL> =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?= Microsoft ASP .NET 0 7th Jun 2004 08:36 AM
The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/822319ev1'. 'HTTP/1.1 500 Internal Server Error'. chanmm Microsoft ASP .NET 1 5th Mar 2004 09:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:59 AM.