campbel8
asked on
Nested IF statements in Crystal.
Hello...
I need to setup a formula in which I need to first check to see if a value is within a given range it will then perform some parsing and determine if the value is within another range. If it is, I need to spit the value out, otherwise I need to return zero. Please trust me on the logic I need to perform, I just really need to know the syntax of how to perform something like the following in Crystal.
IF (accountID in [1 to 10]) THEN
companyNum = Right(accountID, 2)
IF (companyNum = previouslyDefinedValue) THEN
amount
else
0
ELSE
0
Thank you for your help
I need to setup a formula in which I need to first check to see if a value is within a given range it will then perform some parsing and determine if the value is within another range. If it is, I need to spit the value out, otherwise I need to return zero. Please trust me on the logic I need to perform, I just really need to know the syntax of how to perform something like the following in Crystal.
IF (accountID in [1 to 10]) THEN
companyNum = Right(accountID, 2)
IF (companyNum = previouslyDefinedValue) THEN
amount
else
0
ELSE
0
Thank you for your help
I agree with above, but if you need the syntax you requested:
if accountID in [1 to 10] then
{
companyNum = Right(accountID,2)
if companyNum = previouslyDefinedValue then
amount
else
0
}
else
{
0
}
if accountID in [1 to 10] then
{
companyNum = Right(accountID,2)
if companyNum = previouslyDefinedValue then
amount
else
0
}
else
{
0
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
IF (accountID in [1 to 10]) And (Right(accountID, 2)= previouslyDefinedValue) THEN
amount
ELSE
0