Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Conditionally surpress

Newbie in Crystal having a problem with surpressing data

In the detail section, there is a class_name, a start_date and an end_date field for each staff's record

Class A-1 1/1/09 1/12/09

Class A-2 1/13/09 1/19/09

Class B-1 1/5/09 1/5/09

Class B-2 1/7/09 1/9/09

Class B-3 1/11/09 1/15/09

In the footer, there are fields for the minimum of start_date, the maximum of the end_date, grouped on the Class-name. There is also a formula subtracting the minimum_start_date from the CurrentDate to get the number of days the staff is working on each class.

Class A 1/1/09 - 1/19/09 19 days

Class B 1/5/09 - 1/15/09 11 days

The detail is surpressed already but I need to have the footer surpressed (and header too) if ALL the individual's classes are finished within 14 days.

I can't surpress on the formula counting the number of days worked on the classes, nor the dates. Any ideas would be appreciated.

Former Member
Former Member replied

Ok. Instead of adding a table for class_data, add a Command in the Database Expert, and put the following code there:

SELECT strInstr, strStudent, cClassName 
		, MIN(date) as MinDate, MAX(date) as MaxDate
		, MAX(date) - MIN(date) + 1 as ClassDays 
	FROM classData 
	GROUP BY strInstr, strStudent, cClassName

Then, you can suppress on Maximum({Command.ClassDays}, {Command.strStudent}) <= 14.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question