Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / July 2006

Tip: Looking for answers? Try searching our database.

If null then display zero

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pdit - 06 Jul 2006 23:12 GMT
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");
Michel Walsh - 06 Jul 2006 23:48 GMT
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

>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.
[quoted text clipped - 5 lines]
> GROUP BY [Arrest table Query 2].Charges1
> PIVOT [Arrest table Query 2].[Adult or Juvenile] In ("Adult","Juvenile");
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.