Trying to resolve a formula error with a field that include both Alpha and Numeric data. There are some system generated text that I can account for but there's also user entered text that can be just about anything. I need to convert the field to a number field using the tonumber command which works until I run into an Alpha character. Below are the formulas I'm using to determine the data types in the report. The first one @ILGDNO is the problem one. The second line fails because of the multitude of options that users enter in the field when entering data in the system. Bit of a nightmare for a reporting perspective. Basically what I want is if the {itmldg.ilgdno} field is any alpha character then 1 else tonumber {itmldg.ilgdno}.
// PI3030 equals and inventory transacation.
// If not inventory then is it alpha or numeric
@ILGDNO
IF {itmldg.ilgdno}= "PI3030" THEN 0 ELSE
IF {itmldg.ilgdno}<> "PI3030" THEN TONUMBER ({itmldg.ilgdno})
@WHATISIT
//[00001 TO 50000] equals stock transfer order
//[50001 TO 99999] equals purchases
//[100000 TO 500000] equals sales
//[500001 TO 999999] equals production
IF {@ILGDNO} IN [00001 TO 50000] THEN 1 ELSE
IF {@ILGDNO} IN [50001 TO 99999] THEN 2 ELSE
IF {@ILGDNO} IN [100000 TO 500000] THEN 3 ELSE
IF {@ILGDNO} IN [500001 TO 999999] THEN 4 ELSE 0
@WHAT_ANSWER
IF {@WHATISIT}=1 THEN "STOCK TRANSFER" ELSE
IF {@WHATISIT}=2 THEN "PURCHASE" ELSE
IF {@WHATISIT}=3 THEN "SALES" ELSE
IF {@WHATISIT}=4 THEN "PRODUCTION"
@RECEIPT
// Is the transaction a receipt?
IF {@WHATISIT} <> [1 TO 4] AND
{ITMLDG.ILGRCN} >1 THEN 5
// PI3030 equals and inventory transacation.
// If not inventory then is it alpha or numeric
@ILGDNO
IF {itmldg.ilgdno}= "PI3030" THEN 0 ELSE
IF {itmldg.ilgdno}<> "PI3030" THEN TONUMBER ({itmldg.ilgdno})
@WHATISIT
//[00001 TO 50000] equals stock transfer order
//[50001 TO 99999] equals purchases
//[100000 TO 500000] equals sales
//[500001 TO 999999] equals production
IF {@ILGDNO} IN [00001 TO 50000] THEN 1 ELSE
IF {@ILGDNO} IN [50001 TO 99999] THEN 2 ELSE
IF {@ILGDNO} IN [100000 TO 500000] THEN 3 ELSE
IF {@ILGDNO} IN [500001 TO 999999] THEN 4 ELSE 0
@WHAT_ANSWER
IF {@WHATISIT}=1 THEN "STOCK TRANSFER" ELSE
IF {@WHATISIT}=2 THEN "PURCHASE" ELSE
IF {@WHATISIT}=3 THEN "SALES" ELSE
IF {@WHATISIT}=4 THEN "PRODUCTION"
@RECEIPT
// Is the transaction a receipt?
IF {@WHATISIT} <> [1 TO 4] AND
{ITMLDG.ILGRCN} >1 THEN 5