Connecting Tech Pros Worldwide Help | Site Map

Crosstab Query

Sherman H.
Guest
 
Posts: n/a
#1: Nov 13 '05
How to set the blank cell to 0 when a crosstab query is created?

Thanks.


PC Datasheet
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Crosstab Query


When creating your crosstab query, rather than use the field name for the
field(s) that could have Null values, enter an expression like this for the
field in the query grid:
=IIF(IsNull([MyFieldname]),0,[MyFieldName])
When you press Enter after typing this in, ExprX will appear on the left of
the equal sign. Highlight the ExprX and enter some descriptive name for the
query field.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
resource@pcdatasheet.com
www.pcdatasheet.com


"Sherman H." <shung@charter.net> wrote in message
news:10nbef4gv6rc47d@corp.supernews.com...[color=blue]
> How to set the blank cell to 0 when a crosstab query is created?
>
> Thanks.
>
>[/color]


Allen Browne
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Crosstab Query


Use Nz().

Switch the query to SQL View, and change:
Sum(Amount) AS SumOfAmount
to:
Nz(Sum(Amount),0) AS SumOfAmount

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Sherman H." <shung@charter.net> wrote in message
news:10nbef4gv6rc47d@corp.supernews.com...[color=blue]
> How to set the blank cell to 0 when a crosstab query is created?[/color]


Closed Thread