Wesley
Wesley

Reputation: 669

Inserting Missing Dates into Crystal Report

I'm using Crystal Reports 10.

In my database I have production values for each Date. There's a date column and a qty column. When I run a report on this the dates on the report correspond to the dates in the database, but I'd like the report to display every date and if there is no value for it a 0. Is this possible to do right in the report?

The date is a group field with detail suppressed. The numeric values are a sum of the details placed in the group header, if that makes a difference.

enter image description here

enter image description here

Upvotes: 2

Views: 2818

Answers (1)

PowerUser
PowerUser

Reputation: 11791

You have 2 questions.

  1. To display a 0 for null values, you can go into your options menu and "convert database NULL values to default"
    Alternatively, you can use make a new formula with this code and use if isnull({Table1.Amount}) then 0 else {Table1.Amount}. I recommend this option since it won't affect other fields in the report.

  2. To display every date, you should make a 'helper/index' table in your datasource and right-join your actual data to it. Crystal can't display data for, say, 01/07/2010 if there are no records for it.

Upvotes: 2

Related Questions