trim command

  • Thread starter Thread starter Mike Fellows
  • Start date Start date
M

Mike Fellows

I have a text field that i want to cut the last 2 chars at the end of the
string off

the string is of variable length, it is a postcode and is of variable length
i.e.

AA9 9AA
AA99 9AA
A99 9AA
A9 9AA

what i want to be left with from my string is

AA9 9
AA99 9
A99 9
A9 9

i have tried using all combinations of left/right and trim but i cant
successfuly just remove the last 2 charachters

Any help would be greatly appreciated


Mike Fellows
 
Mike Fellows said:
I have a text field that i want to cut the last 2 chars at the end of the
string off

the string is of variable length, it is a postcode and is of variable length
i.e.

AA9 9AA
AA99 9AA
A99 9AA
A9 9AA

what i want to be left with from my string is

AA9 9
AA99 9
A99 9
A9 9

i have tried using all combinations of left/right and trim but i cant
successfuly just remove the last 2 charachters

Left([YourFieldName], Len([YourFieldName])-2)
 
Thanks Rick That was spot on


Rick Brandt said:
Mike Fellows said:
I have a text field that i want to cut the last 2 chars at the end of the
string off

the string is of variable length, it is a postcode and is of variable length
i.e.

AA9 9AA
AA99 9AA
A99 9AA
A9 9AA

what i want to be left with from my string is

AA9 9
AA99 9
A99 9
A9 9

i have tried using all combinations of left/right and trim but i cant
successfuly just remove the last 2 charachters

Left([YourFieldName], Len([YourFieldName])-2)
 
Back
Top