mercredi 7 juin 2017

IF Formula returning error or not doing a section of the formula

I have a formula in my report to select a field based on requirements:

 if not isnull({EXT_TBL.EXT_KEY_TYPE}) then

(if {EXT_TBL.EXT_KEY_TYPE} = "SO" and  {EXT_TBL.EXT_ACTION_FLAG_9} = "Y"
then {EXT_TBL.EXT_TEXT})

else '0'

When I run the report it works ok until I try to load a specific page. When I try to load the page I get an error of 'The string is non numeric'. The formula is called in another formula:

{COR_TBL.COR_EXPECTED_DATE} + 2 + ToNumber({@FRM_NOTES})

I have ran the query on the server of:

SELECT * FROM EXT_TBL WHERE EXT_KEY_TYPE = "SO" AND EXT_ACTION_FLAG_9 = "Y";

This returned me two rows of data. I have narrowed it down to a specific entry that is causing the issue, but in the database the row has N in the field action flag 9 instead of Y so it shouldn't be throwing me the error in my report.

The action field 9 is flagged on only two records both of which contain a 7 in the EXT_TEXT feild so I have no idea why I am getting the error.

I also tried a nested if statement of:

if not isnull({EXT_TBL.EXT_KEY_TYPE}) then

(if {EXT_TBL.EXT_KEY_TYPE} = "SO" then (if {EXT_TBL.EXT_ACTION_FLAG_9} = "Y"
then {EXT_TBL.EXT_TEXT}))

else '0'

But it still gave me the same error.

Thanks

Aucun commentaire:

Enregistrer un commentaire