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

if statement with 2 conditions

Status
Not open for further replies.

fredong

IS-IT--Management
Sep 19, 2001
332
US
for somehow I could make this right. I needed 2 conditions in the if statement with the first condition in the market not in 'A','B','C'or the second condition with the market not in 'D' that has the type "Fruit" then show totalsale by salesperson

Below is my statement and please correct it for me.Thanks


if not{table22;1.Market} in ["A","B","B"]) or
({table22;1.Market}<>"D" and {table22;1.Type} ="fruit")

then
Sum ({table22;1.totalsale}, {table22;1.salesperson})
else 0
 
Your formula looks correct except for the sum. Try:

if not{table22;1.Market} in ["A","B","C"]) or
({table22;1.Market}<>"D" and {table22;1.Type} ="fruit")
then
{table22;1.totalsale}

Then right click on this formula and insert a sum.

-LB
 
I have tried your formula below and it keep returning an error stated that "A boolean is required here" after the if not




if not{table22;1.Market} in ["A","B","C"] or
({table22;1.Market}<>"D" and {table22;1.Type} ="fruit")
then
{table22;1.totalsale}
 
Missing a set of parens:

if not({table22;1.Market} in ["A","B","C"]) or
({table22;1.Market}<>"D" and {table22;1.Type} ="fruit")
then
{table22;1.totalsale}

~Brian
 
Thanks for your help.. I knew I need to put the parenthesis just did not know it was after the if not. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top