Kbase 16715: Report Builder - How to remove hyphen from a field
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
Report Builder - How to remove hyphen from a field
In order to remove a hyphen or other characters from a field in
Report Builder you need to create a calculated field.
Some of the functions available are:
TRIM function will remove it if it's leading or trailing.
Ex. -XXXX-XXXXXX- fieldA
Create calc field:
expression: TRIM(fieldA,"-")
Results = XXXX-XXXXXX
SUBSTRING will work if all the formats are the same.
Create calc1 of substring of 1st 4 and calc2 of substring of 6
calc1=SUBSTRING(fieldA,2,4) calc2=SUBSTRING(fieldA,7,6)
Then create calc3 to combine the two
calc3=calc1 + calc2
Results = XXXXXXXXXX
REPLACE is actually better because it doesn't matter where it is.
REPLACE(fieldA,"-","")
Results= XXXXXXXXXX
Progress Software Technical Support Note # 16715