Replace function in query editor

malter68240968

02-12-2019

Hi,

i would like to replace the first two characters (value is always '33') of a text field with the value '0'. I tried the replace function with a left function inside -> Replace(Field, Left(Field, 2), '0') and i also tried it with a substring function -> Replace(Field (Substring(Field, 1, 2)),'0'). The first case throws an error, the second one works, but it does replace all '33' values in the field and i need it to replace only the first two characters.

Thank you so much in advance for helping out or sharing your ideas on this.

Regards,

Malte

Answers (2)

Answers (2)

malter68240968

04-12-2019

And what does the datalenght function do with datalenght(field)-2. Does it produce all the characters of the field minus the first two of them?

Thank you

malter68240968

04-12-2019

Hi,

thank you for helping, but i think i was not expressing myself clear enough, sorry. I only would like to replace the first two characters, if the value is '33' as condition. Would that work as a part of a case when function?

Thank you!