SQL - INSERT INTO / SELECT FROM, one field with SET value (1 Viewer)

ironfelix717

Registered User.
Local time
Today, 19:25
Joined
Sep 20, 2019
Messages
193
Hi,

Is it possible to provide a SET value in an INSERT/SELECT-FROM query??

EX:
Code:
       SQL = "INSERT INTO ToolingBuilds " & _
      "SELECT ToolID, ToolVersion, ToolCompID, ToolCompVersion, " & _
      "DateModified FROM TempTable;"

In the above, I need to insert all the fields from 'TempTable', but instead of inserting one the fields (say, Tool Version), I need to set the value instead.

Thanks
 

plog

Banishment Pending
Local time
Today, 18:25
Joined
May 11, 2011
Messages
11,613
Most likely in the SELECT do this:

SELECT ToolID, "MyValue" AS ToolVersion, ToolCompID ...
 

ironfelix717

Registered User.
Local time
Today, 19:25
Joined
Sep 20, 2019
Messages
193
Hi,

I get an error when using that.

"Query input must contain at least one table or query"
 

plog

Banishment Pending
Local time
Today, 18:25
Joined
May 11, 2011
Messages
11,613
What is your exact SQL?
 

Users who are viewing this thread

Top Bottom