Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Translating Coded Result toa # 1

Status
Not open for further replies.

mjm19

Technical User
Apr 22, 2003
33
US
Hi,

Using CR8.
I have a coded result that comes over in a result field that
needs to be converted to the same number everytime. In other words the code ABCDEFG is the result that I need to convert to 123456.
This must be pretty simple to do, but escapes me.

Thanks
 
Try:

if {table.code} = "ABCDEFG" then "123456" else {table.code}

-LB
 
If you want to convert it to a number datatype, then try something like:

if {table.code} = "ABCDEFG" then 123456 else
if isnumeric({table.code}) then tonumber({table.code}) else
0

-LB
 
-LB ... thanks very much. One more thing ...
So it does change every ABCDEFG to 123456. How doI suppress
the ABCDEFG code ?
 
I'm not sure what you're asking. You would use a formula like the above in place of your {table.code} field, so you need to be clear on what you want to happen to other results of the {table.code} field. In my last formula, if the result is <> "ABCDEF", but is numeric, the code field will be displayed as a number. If it is non-numeric (and <> "ABCDEF"), it will display as "0".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top