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

Counting zeros in a crosstab report

Status
Not open for further replies.

Tivoli0

MIS
Dec 7, 2001
41
IL
Hi All,

I'm using Access97 & Win95

I have a report that is based on a crosstab query that returns a row for each OBJECTIVE and a column for each GOAL.
The intercept is the counted number of OBJECTIVES in that GOAL. Here is the code:

SELECT DISTINCT [To Do].Objective, Count([To Do].Objective) AS CountOfObjective, [To Do].Goal
FROM [To Do]
WHERE ((([To Do].Completed) Between [Start Date:] And [End Date:]))
GROUP BY [To Do].Objective, [To Do].Goal;

My problem: If the CountOfObjective is null (no value) I get a zero and NO count for that. I do want to count the zeros as it tells me how many COMPLETED tasks have no OBJECTIVE description.

Do I have to create a funcion? How? I'm not that guru and will appreciate any help/code!

TIA, -Ami
 
Hi Tia,
Try a text box with
=IIf(IsNull([nameoffield]),0,[nameoffield])
and a txtbox in report footer with
=sum(IIf(IsNull([nameoffield]),0,[nameoffield]))
I had the same prob with a crosstab and this solved not counting nulls.
Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top