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.

NZ display 0 if query result is nill

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mat - 20 Jul 2006 12:19 GMT
Hello

I have this simple query that either displays a value or can be null,

SELECT [Quaterly total number of workshops aberdeen].CountOfTown
FROM [Quaterly total number of workshops aberdeen];

Having read about the NZ function I would like to display a 0 if is
null.  So I tried this

SELECT Nz([Quaterly total number of workshops
aberdeen].[CountOfTown],0) AS Expr1
FROM [Quaterly total number of workshops aberdeen];

but it doesn't return a 0,

could someone tell me what Im doing wrong, or even how to do it right

Thanks for nay help in advance

Mat
Mohammed issa - 20 Jul 2006 16:18 GMT
Hi,

the query you have wrote is correct, but could you let me know what happen
once you run your query?

bye,

> Hello
>
[quoted text clipped - 17 lines]
>
> Mat
John Spencer - 20 Jul 2006 16:56 GMT
If the query returns zero records (rows) then NZ is not applicable since
nothing is returned.

If the query returns a record (a row) where the field value is null, then NZ
will return the zero.

> Hello
>
[quoted text clipped - 17 lines]
>
> Mat
 
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.