Delete text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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]
 
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]
 
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]
 
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]
 

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

Back
Top