Remove preceeding characters

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

Guest

I have a text field that contains information that looks like this:
........ 7270
I want to be able to remove the preceeding ".....". All of the data does
not have the same amout of "....". Some of the data starts with alpha
characters. (don't know if this makes a difference)
 
Use the Replace function:

Replace([TextFieldName],".","")

in a query, like this:

Update MyTable Set MyField = Replace([MyField],".","");
 
From your sample data and specifications, the result is always "7270". Do you
actually need to return only the rightmost 4 characters?

You might want to open any module and search help on:
Instr()
Left()
Right()
Mid()
 
Thank you. This was helpful until I ran into a field that contained:
".......3.5"
Of course it removed the "." between the 3 & 5. Any idea on how to prevent
that?

Arvin Meyer said:
Use the Replace function:

Replace([TextFieldName],".","")

in a query, like this:

Update MyTable Set MyField = Replace([MyField],".","");
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

2Blessed4Stress said:
I have a text field that contains information that looks like this:
....... 7270
I want to be able to remove the preceeding ".....". All of the data does
not have the same amout of "....". Some of the data starts with alpha
characters. (don't know if this makes a difference)
 
Not with the Replace() function. A custom function that avoided single dots
could be written, or, more simply, if there are only a few you could just
remove them.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

2Blessed4Stress said:
Thank you. This was helpful until I ran into a field that contained:
".......3.5"
Of course it removed the "." between the 3 & 5. Any idea on how to
prevent
that?

Arvin Meyer said:
Use the Replace function:

Replace([TextFieldName],".","")

in a query, like this:

Update MyTable Set MyField = Replace([MyField],".","");
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

2Blessed4Stress said:
I have a text field that contains information that looks like this:
....... 7270
I want to be able to remove the preceeding ".....". All of the data
does
not have the same amout of "....". Some of the data starts with alpha
characters. (don't know if this makes a difference)
 
Back
Top