If null then display zero

P

pdit

I have a crosstab query that I need to display zeros if the field is blank.
Here is my SQL statement. Any help is appreciated.

TRANSFORM Count([Arrest table Query 2].[Arrest date?]) AS [CountOfArrest
date?1]
SELECT [Arrest table Query 2].Charges1
FROM [Arrest table Query 2]
GROUP BY [Arrest table Query 2].Charges1
PIVOT [Arrest table Query 2].[Adult or Juvenile] In ("Adult","Juvenile");
 
M

Michel Walsh

Hi,



TRANSFORM NZ(Count([Arrest table Query 2].[Arrest date?]),0) AS
[CountOfArrest
date?1]
SELECT [Arrest table Query 2].Charges1
FROM [Arrest table Query 2]
GROUP BY [Arrest table Query 2].Charges1
PIVOT [Arrest table Query 2].[Adult or Juvenile] In ("Adult","Juvenile");




I added a NZ( , 0) around the COUNT().


Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top