Delete text

E

Eva

Hi,

I have a table with a column that look like this:

stockholm/solna
goteborg/askim

If a want to delete everything before the slash and the slash. How do I do
that?

Pls help!
 
J

John Vinson

Hi,

I have a table with a column that look like this:

stockholm/solna
goteborg/askim

If a want to delete everything before the slash and the slash. How do I do
that?

Pls help!

To permanently and irrevokably delete it (you might want to make a
backup of your .mdb file first): run an Update query and update this
field to

Mid([fieldname], InStr([fieldname], "/") + 1)

InStr finds the position of the slash character; Mid() is a substring
function which returns the rest of the string after that position.

John W. Vinson[MVP]
 
E

Eva

I wrote this in my query:

UPDATE Lasse SET Mid(Kommun, InStr(Kommun, "/") + 1);

and I get an Update-error. What is wrong? Does this query work in Access2000?

/Eva


"John Vinson" skrev:
Hi,

I have a table with a column that look like this:

stockholm/solna
goteborg/askim

If a want to delete everything before the slash and the slash. How do I do
that?

Pls help!

To permanently and irrevokably delete it (you might want to make a
backup of your .mdb file first): run an Update query and update this
field to

Mid([fieldname], InStr([fieldname], "/") + 1)

InStr finds the position of the slash character; Mid() is a substring
function which returns the rest of the string after that position.

John W. Vinson[MVP]
 
J

John Vinson

I wrote this in my query:

UPDATE Lasse SET Mid(Kommun, InStr(Kommun, "/") + 1);

and I get an Update-error. What is wrong? Does this query work in Access2000?

It does... but you need to specify which field you're updating! Try

UPDATE Lasse SET Kommun = Mid(Kommun, InStr(Kommun, "/") + 1);

John W. Vinson[MVP]
 
E

Eva

Thank you! Now it works..

"John Vinson" skrev:
It does... but you need to specify which field you're updating! Try

UPDATE Lasse SET Kommun = Mid(Kommun, InStr(Kommun, "/") + 1);

John W. Vinson[MVP]
 
Top