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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Boolean question – if/or

Status
Not open for further replies.

shannonlp

Technical User
Feb 9, 2006
163
US
Hi,

Can someone tell me what’s wrong with this formula? I’m trying to set the condition in which the {TRANSACTION_REPORT_VIEW2.TXN_COUNT} field displays a value. I’m getting

The keyword ‘then’ is missing’

Can I not do or if? I think I’m missing something really obvious.

Any help would be much appreciated.


If {TRANSACTION_REPORT_VIEW2.BILLING_CODE} = 'WI'
and {TRANSACTION_REPORT_VIEW2.BILLING_TXN_CODE} in ['155', '160', '052', '054']
or
if {TRANSACTION_REPORT_VIEW2.BILLING_CODE} = 'SK'
and {TRANSACTION_REPORT_VIEW2.BILLING_TXN_CODE} = '080'
or
if {TRANSACTION_REPORT_VIEW2.BILLING_CODE} = 'AD'
and {TRANSACTION_REPORT_VIEW2.BILLING_TXN_CODE} = '001'
then {TRANSACTION_REPORT_VIEW2.TXN_COUNT}
else 0


 
Since you only have two possible outcomes, you only need one If - isolate the conditions with parens:

If
({TRANSACTION_REPORT_VIEW2.BILLING_CODE} = 'WI'
and {TRANSACTION_REPORT_VIEW2.BILLING_TXN_CODE} in ['155', '160', '052', '054'])
or
({TRANSACTION_REPORT_VIEW2.BILLING_CODE} = 'SK'
and {TRANSACTION_REPORT_VIEW2.BILLING_TXN_CODE} = '080')
or
({TRANSACTION_REPORT_VIEW2.BILLING_CODE} = 'AD'
and {TRANSACTION_REPORT_VIEW2.BILLING_TXN_CODE} = '001')

then {TRANSACTION_REPORT_VIEW2.TXN_COUNT}

else 0


(This is untested)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top