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

Stored Proc Nulls displayed as zeros!

Status
Not open for further replies.

tman135

Programmer
Feb 28, 2001
48
US
I've got a complicated stored proc building a result set to feed to crystal. Some fields have nulls values. If there is data in the field, it is decimal value.

I want to group this data based on a date range and then averages of the fields which may contain nulls. Crystal is showing 0.00 for all null values and then averages the 0.00 in with the real data on a summary. If I have 8.5 and 0.00 (which is really null) I want the average to be 8.5.

Any help would be appreciated
 
You can create a summary field or running total (depending upon your version of Crystal).

In the middle frame called "Evaluate" click on the Formula button and create a formula for when the field is not null. Fill the Summary frame (average, sum, count) and Reset frame (reset on a group, never reset, etc.) as needed.
 
A Report Option is to convert null values to default, which in this case would be zero. Sounds like you want to ensure this option is not selected, so that you get nulls returned in an unconverted state.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top