We help IT Professionals succeed at work.

# Crystal Reports Suppression Criteria

on
Hi there,

I have what I thought was simple suppression criteria for my group but it's not returning the results I need, ;

if {?Days Over Due} = "All Pledges" then FALSE

//less than thirty days overdue but not negative or 0    *this returns negatives as well as values over 29
else if {?Days Over Due} = "Less than 30"
then ({@Days Overdue} <=0
and {@Days Overdue} >29)

//inclusive of 30 and 90 excluding less than 30 and greater than 90 *this returns similar results
else if {?Days Over Due} = "Between 30 and 90"
then ({@Days Overdue} <30
and {@Days Overdue} >90)

//inclusive of all over 90
else if {?Days Over Due} = "Greater than 90"
then {@Days Overdue} <=90

Any help would be appreciated!

Thank you - CS
Comment
Watch Question

## View Solutions Only

Software Developer

Commented:
Hi,
Suppression condition result should be a Boolean value. First 3 conditions always results in false as 2nd and 3rd are:

else if {?Days Over Due} = "Less than 30"
then ({@Days Overdue} <=0
and {@Days Overdue} >29)
--> this will always be false since Days Overdue will be a single value and you are trying to check for 2 values using and conditions

//inclusive of 30 and 90 excluding less than 30 and greater than 90 *this returns similar results
else if {?Days Over Due} = "Between 30 and 90"
then ({@Days Overdue} <30
and {@Days Overdue} >90)
--> here also same as above.

The 4th condition also looks contradictory.

Can you provide the details of exactly the 4 conditions and whether the report section needs to be suppressed or displayed for those? conditions?
Software Developer

Commented:
If feasible, provide report with some saved data and information of suppress conditions
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
The ANDs should be ORs.

The Days Overdue cannot be both Less than 30 and greater than 90

mlmcc
Commented:
I think mlmcc nailed it and your ANDs should be ORs.

FWIW, assuming that those are the only possible values for {@Days Overdue}, I would probably write your tests as:

``````not ({?Days Over Due} = "All Pledges" or
//less than thirty days overdue but not negative or 0
({?Days Over Due} = "Less than 30" and {@Days Overdue} in 0 _to 29) or
//inclusive of 30 and 90 excluding less than 30 and greater than 90
({?Days Over Due} = "Between 30 and 90" and {@Days Overdue} in 30 to 90) or
//inclusive of all over 90
({?Days Over Due} = "Greater than 90" and {@Days Overdue} > 90))
``````

That's untested, of course, but I think I got the conditions right.

I find it easier to follow the logic by writing the condition for the items that you want to see, and then using Not to reverse that for the suppression.

The "_to" in "{@Days Overdue} in 0 _to 29" says to exclude the lower end of the range (0 in this case).  So, assuming whole numbers, 0 _to 29 is the same as 1 to 29.

James