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

Use Null Value to Eliminate Group from Report

Status
Not open for further replies.

BradW

IS-IT--Management
Nov 30, 2000
126
US
Good evening, I have a report that I'm working on in Crystal Reports Pro XI using a SQL Server database (2005).

I have the records grouped and displaying correctly. Each group has at least two records, some have many more. Many groups have different numbers of records.

Each record has a record date field. Some records are missing the date. If any one (or more) records in a particular record are missing the date, I need to eliminate the entire group from the report.

Each group footer has a number of calculated formulas and some running total fields as well.

I can write a formula to determine if the date field is present or not for each record, but I can not get the formula to sumarize in the group footer so I can use it to select out the groups that have one or more records with missing date fields.

Can someone give me an idea on how I can do this?

Thanks much in advance for all ideas and suggestions.
 
Hi,
Try using your formula that tests the date field for NULL or blank as a 'Supress Group' formula.





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
1- Create a formula that will test for null date and return 1 if null and 0 if not.

2- put a sum upon this formula per the group you already have.

3- In the group selection formula, select the groups with sum < 1 .
 
Boy, I left the most important part out, very SORRY, it was late and I was tired after trying to solve this problem.

The date in question is in a running total field because it comes from a child table that that has many dates. A bit more info that I should have included originally:

1) There is a parent/master table that has information about an order.

2) There is a child table that shows a trail of dates and actions related to the order, the date that the order was placed, the date it was shipped, the date it arrived and so on.

I have a running total showing the date that the order arrived - I used a running total so I could grab the date field and use the formula part of the running total to show the field that contains the nature of the date {date.action}="Arrived"

Based on using this running total to pick out the specific date from several in the child table, The null function and the If..then..else suggestion don't work because the results of these formulas can not be summmarized by Crystal.

Very sorry that I left this out, and THANKS MUCH for all assistance.
 
Use a formula {@Arrived} like this instead of using a running total:

if {date.action} = "Arrived" then {table.date}

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

maximum({@Arrived},{table.group}) > date(0,0,0)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top