Hi, I am looking for some clarity in how Crystal Reports XI handles "or" statements and the "not in ....." statements. I have 2 formulas below, the top one works fine and I get the proper results, but the bottom one returns the same result as the top one -- the fields table1.cd1, table1,cd2, etc do contain null values (however I have the "convert database nulls to default" turned on Crystal reports.
can someone help me, so that I can make the bottom formula return the proper result?
THIS WORKS:
If {table1.class} in ["1","6"] and
(
({table1.TYPE}="A" and
({table1.CD1}in ["15","21","23"] or
{table1.CD2}in ["15","21","23"] or
{table1.CD3}in ["15","21","23"] or
{table1.CD4}in ["15","21","23"] or
{table1.CD5}in ["15","21","23"]))
or
({table1.TYPE}="B" and
({table1.CD1}="15" or
{table1.CD2}="15" or
{table1.CD3}="15" or
{table1.CD4}="15" or
{table1.CD5}="15" ))
)
then {table1.BALANCE} else 0.00
THIS DOES NOT WORK: gives me the same balance as above formula
If {table1.class} in ["1","6"] and
(
({table1.TYPE}="A" and
(not({table1.CD1}in ["15","21","23"]) or
not({table1.CD2}in ["15","21","23"]) or
not({table1.CD3}in ["15","21","23"]) or
not({table1.CD4}in ["15","21","23"]) or
not({table1.CD5}in ["15","21","23"])))
or
({table1.TYPE}="B" and
({table1.CD1}<>"15" or
{table1.CD2}<>"15" or
{table1.CD3}<>"15" or
{table1.CD4}<>"15" or
{table1.CD5}<>"15" ))
)
then table1.balance else 0.00
---------------------------
Thanks
DB
can someone help me, so that I can make the bottom formula return the proper result?
THIS WORKS:
If {table1.class} in ["1","6"] and
(
({table1.TYPE}="A" and
({table1.CD1}in ["15","21","23"] or
{table1.CD2}in ["15","21","23"] or
{table1.CD3}in ["15","21","23"] or
{table1.CD4}in ["15","21","23"] or
{table1.CD5}in ["15","21","23"]))
or
({table1.TYPE}="B" and
({table1.CD1}="15" or
{table1.CD2}="15" or
{table1.CD3}="15" or
{table1.CD4}="15" or
{table1.CD5}="15" ))
)
then {table1.BALANCE} else 0.00
THIS DOES NOT WORK: gives me the same balance as above formula
If {table1.class} in ["1","6"] and
(
({table1.TYPE}="A" and
(not({table1.CD1}in ["15","21","23"]) or
not({table1.CD2}in ["15","21","23"]) or
not({table1.CD3}in ["15","21","23"]) or
not({table1.CD4}in ["15","21","23"]) or
not({table1.CD5}in ["15","21","23"])))
or
({table1.TYPE}="B" and
({table1.CD1}<>"15" or
{table1.CD2}<>"15" or
{table1.CD3}<>"15" or
{table1.CD4}<>"15" or
{table1.CD5}<>"15" ))
)
then table1.balance else 0.00
---------------------------
Thanks
DB