Hello James,
>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.So I'll presume you are trying to get rid if the hyphen and everything to the right of it in one particular field of a table.
>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.If the field name is xx
? AT(xx,"-")
? SUBSTR(xx,1,AT("-",xx)-1)
REPLACE xx WITH SUBSTR(xx,1,AT("-",xx)-1)
HTH
Randy Bosma
VFP - Because life is too short to code in something else...