General information
Category:
Coding, syntax & commands
Title:
Removing characters from string
hey everyone,
here is my problem. i have a table field with some data (stating the obvious has always been a gift). what i am trying to do is trim certain data within the field. an example is as follows:
table field data: exampleofdata-1234
what i want to do is trim the right side so that the data within the data field just says:
exampleofdata.
i am able to determine whether or not the data has the hyphen with a statement like:
if right(rtrim(substr(table.field, 1, 25)),5) = '-'
what i cannot figure out is how to get rid of those last 5 characters from the string.
the substr is for 25 spaces because all the data in the field is not uniform and i need to perform this check on all the within that field. can anyone help me with this problem. if it seems unclear to anyone, i will be more than happy to try to explain it again. i know it reads kind of confusing. any help is appreciated. thanks.
james
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only