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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with SQL Update Select Statement

Status
Not open for further replies.

dmoonme80

Technical User
Sep 26, 2005
6
US
I was trying to do something like this:

UPDATE Path SET Table_Paths.path = (SELECT '\\' + s_name + '\' + sh_name from Shares);

But I get a "Operation must use an updateable query."
What is the correct syntax? Thanks!
 
Try this:
UPDATE Path SET Table_Paths.path = DLookup("'\\' & s_name & '\' & sh_name", "Shares");


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks for the replies but no luck yet. Let me give more details of what I'm trying to accomplish.

"Shares" table I have 2 fields s_name and sh_name

s_name sh_name
------- -------
serverA share1
serverA share2
serverB share3

I want to combine the fields and put them into the "Path" field in "Table_Paths" table.

So "Table_Paths" table records would look like this:

Path
----------------
\\serverA\share1
\\serverA\share2
\\serverB\share3


 
You wanted this ?
INSERT INTO Table_Paths (path)
SELECT '\\' + s_name + '\' + sh_name FROM Shares;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top