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

Suppress record if any other associated record = something

Status
Not open for further replies.

staciann

IS-IT--Management
Nov 1, 2006
72
US
Hi. I am creating a report and I need to suppress records if another record is conditionally suppressed within it's group. For example, if I have:

COMPANY ABC (group)
Project 1 (details)
Project 2
Project 3
Project 4

and I conditionally suppress any detail records that were started after 1/1/06, I then want to suppress the entire group and all of the details within it. If 'Project 3' was completed 2/3/08, I want the whole group and details suppressed.

I know I can suppress the group name by putting in the same conditions, but I don't know how to suppress the other detail records within the group.

Thanks, I'd greatly appreciate any help you can offer.
 
If you don't want records that were started after 1/1/06, why not eliminate them in the record selection? Much more efficient.

If you need them for something else, you might need to do a subreport to do either the detail display or the other function.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Well, that's not exactly what I want. I'm trying to find all of the companies that sent us projects 3-5 years ago, but haven't sent a project in since then (so I can send all of them a mailer).

Eliminating just the projects (details/records) that are after 1/1/06 will still give me any projects a company had previous to that date. I don't want the company or any of its projects to come up on my list if they've sent anything in after 1/1/06.

Each company has multiple projects. If I have the company as Group I and project # and contact info in the details, I need the whole group and its details (all projects before 1/1/06)to be suppressed if there was any project sent in after 1/1/06.

Does that make more sense? Sorry, I'm not quite sure how else to explain it. I need a formula that pretty much says: If any record in group has a start date after 1/1/06 then suppress all records in group

Is there a way to do that?
 
You could write a formula in the details section that checks the start date.
e.g.
Code:
if {YourTable.ProjectStartDate} > Date(2006,01,01) then 1 else 0
Now, suppress the formula, and sum it for the group.
Do Group Selection that says:
Sum(@YourFormulaField,YourCompanyGroup)=0

This ought to suppress Company groups where one of the projects for that company was started post Jan 1 06 (which is what I THINK you're asking.-apologies if I got that wrong)


Bob Suruncle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top