Replacing characters

  • Thread starter Thread starter Vel
  • Start date Start date
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
 
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])
 
Back
Top