Replacing characters

V

Vel

Hello,

Is there a way, preferably in a query, to replace the
last two characters of a particular field with two
different characters?

For example, I have a field in a query, which lists a
bunch of comma separated values. The last possible value
ends with a period. I want a function something like
this:

NewField: iif(right([MyField],2)=", ", [Myfield]
with ". " instead of ", ", [MyField] )

Now, I just cant figure out which functions to utilize in
order to replace just the last to characters of a
variable length string...

Vel
 
V

Vel

Hello Again,

I found a work-around that did the trick.

[MyField] (potential to end with a comma)

[inMyField]: len([MyField])

[NewField]: iif(Right([MyField]=", "), left([MyField],
[inMyField]-2) & ". ", [MyField])
 

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

Similar Threads


Top