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

Yes No Formula Capture for Three fields

Status
Not open for further replies.

lbunch

Programmer
Sep 5, 2006
120
US
As you can see below I am checking various fields to display values on a report. Is this the best way and what am I leaving out?? Do I need to place every instance of Yes or No if all three fields are not Yes???


If {@DefltChk_Display}="Yes"
and{@DateChk_Display}="No"
and{@ExcpChk_Display}="Yes"then
"A"+","+"C"
else
If {@DateChk_Display}= "No"
and {@DefltChk_Display}="No" then
"C"
else
If({@DateChk_Display})= "Yes"
and ({@DefltChk_Calc}) = "Yes"
and {@ExcpChk_Display}= "No" then
"A"+","+"B"
else
if ({@DateChk_Display}) = "Yes"
and ({@DefltChk_Display}) = "Yes"
and ({@ExcpChk_Display})= "Yes" then
"A"+","+"B"+","+"C"
else
If {@DateChk_Display}="Yes" then
"A"
else
if {@DateChk_Display}= "Yes" then
"B"
else
if{@ExcpChk_Display}= "Yes" then
"C"

 
Looks like a continuation of another thread.

Try:

whileprintingrecords;
stringvar output:="";
if {@DateChk_Display} = "Yes" then
output:="A,";
if {@DefltChk_Display} = "Yes" then
output:=Output+"B,";
If {@ExcpChk_Display} = "Yes" then
output:=Output+"C,";
if len(Output) > 0 then
left(Output,len(output)-1)
else
"N/A"

Replacing "N/A" with whatever you wish to display if none of the conditions exist.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top