Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT INTO with SELECT statement error 1

Status
Not open for further replies.

ksbigfoot

Programmer
Joined
Apr 15, 2002
Messages
856
Location
CA
Can someone see what I am doing wrong here?

I am getting an error
"Syntax error. in query expression 'SELECT 91 AS WOSubTasksID'"

Here is my query statement:
Code:
INSERT INTO dbo_WOSubTasksAssigned (WOSubTasksID, WOTaskListID, WOAssignedToID) VALUES (SELECT 91 AS WOSubTasksID, WOTaskListID, 10 As WOAssignedToID FROM dbo_AutoWOTaskList WHERE AutoWOServicesID = 2)
Thanks
 
INSERT INTO dbo_WOSubTasksAssigned (WOSubTasksID, WOTaskListID, WOAssignedToID)
SELECT 91, WOTaskListID, 10
FROM dbo_AutoWOTaskList
WHERE AutoWOServicesID = 2

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Howdy PHV, Very nice, worked perfectly.
Star to you.
Thanks again,
ksbigfoot

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top