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

Crosstab - Placing zeroes where the fields are null

Status
Not open for further replies.

shaleen7

MIS
Jun 23, 2002
188
US
I have a crosstab query in Crystal 9 that count number of books received in a month.

The crosstab query displays the information like this:
Jan
10


However I want every month to be displayed regardless of whether a book has been received.
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
10 0 0 0 0 0 0 0 0 0 0 0

Any suggestions?

Thanks so much.
 
At issue here is whether you have any data for those months, if not, I generally suggest using a Periods Table:

faq767-4532

You also might create a set of formulas to accomplish this (rather than a crosstab) since you only have 12 months to worry about.

They would hold something like:

whileprintingrecords;
numbervar month1;
If datadiff("m",{table.date},currentdate) = 11 then
month1:=month1+{table.qty};
month1

-k

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top