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

How to add default (0) values to a cross tab totals field

Status
Not open for further replies.

dpimental

Programmer
Jul 23, 2002
535
0
0
US
All, I have query for a report, that lists engineers and how many projects they are working on of x type, y type and z type. My problem is that they do not always work on each of the types.

I want to use a calculated field on a report but need to insert default 0 values, where the field value is null.

Any way to do that.
It would look like this ...

type x eng1 eng2 eng3 eng4
apple 1 4 4
orange 2 3 3
pear 1 1 1

I want it to look like this

type x eng1 eng2 eng3 eng4
apple 1 4 0 4
orange 2 0 3 3
pear 0 1 1 1



David Pimental
(US, Oh)
 
dpimental,
In the QBE pane make the following changes to the Crosstab Value field:

Field[tab]:[tab]Move the domain aggregate function (from the total row) into
[tab][tab][tab][tab]the field definition and wrap the whole thing in the [tt]Nz()[/tt] function.
[tab][tab][tab][tab]i.e. Expr1: [tt]Nz([/tt]Sum([Field Name])[tt],0)[/tt]
Total[tab]:[tab]Change the domain aggregate function (Sum in this example) to Expression

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Thanks, I will give it a try (Don't You Just Love Access?)!

David Pimental
(US, Oh)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top