Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement