Update SQL Query

R

RC-

I have a field in a table that I need to update. The current field reads
"picture.jpg". I need to update the field to include the entire path, i.e.
"C:\Folder1\Folder2\Folder3\". But I need to keep the original value so the
end result will be "C:\Folder1\Folder2\Folder3\picture.jpg". Is this
possible using a SQL statement?

TIA
RC-
 
V

Van T. Dinh

UPDATE [YourTable]
SET [PathField] = "C:\Folder1\Folder2\Folder3\" & [PathField]
 
R

RC-

Thanks Van, I had a feeling it would be easy!

Van T. Dinh said:
UPDATE [YourTable]
SET [PathField] = "C:\Folder1\Folder2\Folder3\" & [PathField]

--
HTH
Van T. Dinh
MVP (Access)


RC- said:
I have a field in a table that I need to update. The current field reads
"picture.jpg". I need to update the field to include the entire path, i.e.
"C:\Folder1\Folder2\Folder3\". But I need to keep the original value so the
end result will be "C:\Folder1\Folder2\Folder3\picture.jpg". Is this
possible using a SQL statement?

TIA
RC-
 
F

fredg

I have a field in a table that I need to update. The current field reads
"picture.jpg". I need to update the field to include the entire path, i.e.
"C:¥Folder1¥Folder2¥Folder3¥". But I need to keep the original value so the
end result will be "C:¥Folder1¥Folder2¥Folder3¥picture.jpg". Is this
possible using a SQL statement?

TIA
RC-

Update YourTable Set YourTable.FieldName =
"c:\Folder1\Folder2\Folder3\" & [FieldName];
 
R

RC-

Oops, spoke to soon. When I try that the end result is a -1. What am I
doing wrong. Here is a copy of the query I tried.

UPDATE Movies
SET Movies.PosterPath = "C:\Documents" And "Settings\_Movies DB\" &
Movies.PosterPath;


Van T. Dinh said:
UPDATE [YourTable]
SET [PathField] = "C:\Folder1\Folder2\Folder3\" & [PathField]

--
HTH
Van T. Dinh
MVP (Access)


RC- said:
I have a field in a table that I need to update. The current field reads
"picture.jpg". I need to update the field to include the entire path, i.e.
"C:\Folder1\Folder2\Folder3\". But I need to keep the original value so the
end result will be "C:\Folder1\Folder2\Folder3\picture.jpg". Is this
possible using a SQL statement?

TIA
RC-
 
K

Ken Snell [MVP]

What is the path you want?
C:\Documents\Settings\_Movies DB\

If this is what you want, then do as Van said:
UPDATE Movies
SET Movies.PosterPath = "C:\Documents\Settings\_Movies DB\" &
Movies.PosterPath;

Or
UPDATE Movies
SET Movies.PosterPath = "C:\Documents\" &
"Settings\_Movies DB\" &
Movies.PosterPath;

--

Ken Snell
<MS ACCESS MVP>

RC- said:
Oops, spoke to soon. When I try that the end result is a -1. What am I
doing wrong. Here is a copy of the query I tried.

UPDATE Movies
SET Movies.PosterPath = "C:\Documents" And "Settings\_Movies DB\" &
Movies.PosterPath;


Van T. Dinh said:
UPDATE [YourTable]
SET [PathField] = "C:\Folder1\Folder2\Folder3\" & [PathField]

--
HTH
Van T. Dinh
MVP (Access)


RC- said:
I have a field in a table that I need to update. The current field
reads
"picture.jpg". I need to update the field to include the entire path, i.e.
"C:\Folder1\Folder2\Folder3\". But I need to keep the original value so the
end result will be "C:\Folder1\Folder2\Folder3\picture.jpg". Is this
possible using a SQL statement?

TIA
RC-
 
V

Van T. Dinh

The And got to be in the String delimiters ".

Try:

UPDATE Movies
SET Movies.PosterPath = "C:\Documents And Settings\_Movies DB\" &
Movies.PosterPath;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top