Hi-
I have a 15 character string field that usually contains a zero filled number - like "00000000001234". Sometimes, however, the field may contain alpha characters.
So, I'd like to suppress the leading zeros, when the field is numeric, and print the whole field when non-numeric. I've tried to creatre a formula to do this:
If NumericText ({OEORDHDR_SQL.Cus_Alt_Adr_Cd}) Then
ToNumber ({OEORDHDR_SQL.Cus_Alt_Adr_Cd})
else
{OEORDHDR_SQL.Cus_Alt_Adr_Cd};
but on checking, I'm told "A number is required here" following the "else". Without the else, a zero is printed instead of the valid string. Conversely, if I change the formula to check "If Not NumericText" the error message tells me a string is required after the else.
Any ideas?
I'm using Crystal v8.
Thanks in advance.
BobG
I have a 15 character string field that usually contains a zero filled number - like "00000000001234". Sometimes, however, the field may contain alpha characters.
So, I'd like to suppress the leading zeros, when the field is numeric, and print the whole field when non-numeric. I've tried to creatre a formula to do this:
If NumericText ({OEORDHDR_SQL.Cus_Alt_Adr_Cd}) Then
ToNumber ({OEORDHDR_SQL.Cus_Alt_Adr_Cd})
else
{OEORDHDR_SQL.Cus_Alt_Adr_Cd};
but on checking, I'm told "A number is required here" following the "else". Without the else, a zero is printed instead of the valid string. Conversely, if I change the formula to check "If Not NumericText" the error message tells me a string is required after the else.
Any ideas?
I'm using Crystal v8.
Thanks in advance.
BobG