I need to trim the last 4 characters off a string that is not consistent in length.
Ex: PG 02466 - 0 needs to be PG 02466
03300 - 1 needs to be 03300
03 30 00 - 0 needs to be 03 03 00
The last 4 characters will always be ' - #'
Any ideas?
Printable View
I need to trim the last 4 characters off a string that is not consistent in length.
Ex: PG 02466 - 0 needs to be PG 02466
03300 - 1 needs to be 03300
03 30 00 - 0 needs to be 03 03 00
The last 4 characters will always be ' - #'
Any ideas?
Welcome to CodeGuru forums!
If it is Crystal Reports, then :
I would use the Left and the Length functions, as :
Code:Left({Tablex.Fieldx}, Length({Tablex.Fieldx}) - 4)
You are awesome. That was the last piece I needed!