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

nest if else

Status
Not open for further replies.

cgunkel

Programmer
Joined
Jul 9, 2001
Messages
9
Location
CA
I have 2 nested if else statements and I only get the expected results from the first if statement when I comment out the second if. What am I doing wrong?


If {?@ai_detailed_by} = 1 then
If {r_budget_to_actual_raw_data;1.mdty_name} = "N/A" Then
"Not here1"
Else
"Here1";

If {?@ai_detailed_by} = 2 then
If {r_budget_to_actual_raw_data;1.mdty_name} = "N/A" Then
"Not here2"
Else
"Here2"
 
try this

If {?@ai_detailed_by} = 1 then
(
If {r_budget_to_actual_raw_data;1.mdty_name} = "N/A" Then
"Not here1"
Else
"Here1";
)

Else If {?@ai_detailed_by} = 2 then
(
If {r_budget_to_actual_raw_data;1.mdty_name} = "N/A" Then
"Not here2"
Else
"Here2";
)

//this is optional but you should have a catch_all for data
//that doesn't the above conditions

Else

"Data not Matched";

Also...if it is in a formula that is not associated with grouping the the formula should be prefaced with:

WhilePrintingRecords

Jim
JimBroadbent@hotmail.com


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top