Trim a word from a field

L

Liz C

I have a field [meter_name] and I have it in a query, but if the word
"compressor" is in that field, I want it to remove it. Can someone please
tell me how to trim that word out?

Thanks in advance!

Liz
 
F

fredg

I have a field [meter_name] and I have it in a query, but if the word
"compressor" is in that field, I want it to remove it. Can someone please
tell me how to trim that word out?

Thanks in advance!

Liz

Access 2000 or newer?

NewField:Replace([meter_name],"Compressor","")
 
L

Liz C

Thank you Fred. That worked great! Do you know how I would remove any
numeric characters from the field also?

fredg said:
I have a field [meter_name] and I have it in a query, but if the word
"compressor" is in that field, I want it to remove it. Can someone please
tell me how to trim that word out?

Thanks in advance!

Liz

Access 2000 or newer?

NewField:Replace([meter_name],"Compressor","")
 
F

fredg

Thank you Fred. That worked great! Do you know how I would remove any
numeric characters from the field also?

fredg said:
I have a field [meter_name] and I have it in a query, but if the word
"compressor" is in that field, I want it to remove it. Can someone please
tell me how to trim that word out?

Thanks in advance!

Liz

Access 2000 or newer?

NewField:Replace([meter_name],"Compressor","")

For example???
We can't see your database. If you have a specific question please
don't ask a generalized question. There are, I'm sure, many methods to
remove unwanted characters from a field, from a user defined function
which will cycle through teh field's data, to nesting Replace()'s.
Which to use depends upon your data and what you wish to get back.
Perhaps you can simply use a multi replace function.
I'll give you 0 to 4. simple add 5 to 9 in the expression:

Replace(Replace(Replace(Replace(Replace([Meter_Name],"0",""),"1",""),"2",""),"3",""),"4","")
etc., nesting the other numbers within the above expression ....

If the above is not suitable, then, if you are specific, I'll be
specific.
Give a few samples of the data, and an example of what you want to
see.
 

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