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

Reporting Null values

Status
Not open for further replies.

Rob32

Technical User
Oct 14, 2002
18
NZ
Hi

I fear this question may be something incredibly basic, but...

I have a report that includes a number of fields - until now this report appears to have worked OK. However, I have added a field that not all records will have a value associated ie. for some records, that field will have no entry. Problem is, CR seems to only want to report the fields that DO have data associated with that field. I want to report all records, regardless of whether they have a value associated to that field or not.

I am reporting the field data using an if...then...else formula, but the problem seems to occur even if I add the DB field by itself to the report.

I am using CR 7, & the data comes from a SQL DB.

Thanks, Rob32.
 
Are you basing your report off a query?

If so you may need to use outer joins to include the null values in your report.

Transcend
[gorgeous]
 
Also, if you are using this filed in a formula, you will need to do a null test first:

If IsNull({YourField}) then 0 else <<CalculationLogic>> Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Null values are one of the hazards of Crystal, because it will abandon processing without warning if it comes across one. As dgillz said, test using ISNULL. But be sure to test for everything that can be null before testing anything else. Madawc Williams
East Anglia
Great Britain
 
Thanks all

I wasn't reporting off a query, but the outer join advice was great - I hadn't done it in the report, and when I changed the links to outer joins, it worked like a charm. It seems to be reporting all the null values fine, without me doing a null test in the formula. Is that good, or should I do the null test anyway? And where do I place the null test - within the formula producing the data,or as a record selection formula?

Cheers, Rob32
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top