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

How to conditional suppress whole group section

Status
Not open for further replies.

gegeying

Programmer
Feb 22, 2007
14
0
0
US
(crystal 8.5)


Here is the example
Location 1
workorder 1
John Doe 6/12/2007 4hrs
Temp 6/21/2007 8hrs
Workorder 2
Mary 7/01/2007 6hrs
Tom 7/12/2007 8hrs


Since for workorder1, the 2nd record contain "temp", I need the whole group "workorder1" to suppress. how to do that?

Thanks in advance.
 
You'll be able to most efficiently do this if your database/connectivity supports use of SQL Expression fields.

Is the field that contains the 'Name' field in the same table as the Workorder?

In any case, the SQL Expression field would look something like this *(name it 'TempCount'):
[tt]
(SELECT COUNT(*) FROM WORKORDER where WO = "WORKORDER "."WO" and [YourNameField] = 'Temp')[/tt]

In your record selection formula, you'd use the SQL Expression field to filter out any work orders that contain 'Temp':
[tt]
{%TempCount} = 0[/tt]

* I'm making some assumptions of field/group names based on a previous post

-dave
 
dave,

Nice to see you back!

gegeying,

If you can implement vidru's suggestion, you should go that way, but you could instead create a formula {@temp} like this:

if {Table.name} = "temp" then 1

Then go to report->selection formula->GROUP and enter:

sum({@temp},{table.workorder}) = 0

Then you would need to use running totals if you have to summarize any results across groups, since non-group selected records would contribute to the more usual inserted summaries.

-LB
 
How's it goin' LB?

For the record, that was going to be my backup solution, but who wants to deal with all of that running total mucky-muck if you can just get those records the heck out of there to begin with?

-dave
 
I agree! How's the soap-making business (if I remember correctly)?

-LB
 
gegeying,

Apologies for the hijack...

LB,
My wife is still doing the soap thing, but not putting very much energy into it (the kids, 4 and 7, are still sucking the life out of her). We do have a few retailers that are doing pretty well with it though, especially right now, with the holidays and all. You deserve some soap, LB, for everything you do for these forums. You should peruse my profile for a way to, um, get in touch with me...

-dave
 
Yes, I see. My apologies, too, gegeying.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top