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 / Developer Toolkits / May 2007

Tip: Looking for answers? Try searching our database.

Replace null value with zero

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Reynolds Inc - 28 Mar 2007 01:55 GMT
I am building queries off of other queries in Access. The table that one of
the first queries is retrieving info from has no data for this particular
query. Therefore when I run a query off the first query, it is returning a
null value in a cell that will then be queried (along with others) and
added up for a total value. So when the null value is added to the other
values, it returns a null value.

What I would like to do is have a process in place that will tell Access to
substitute the null value with a number zero. Is there a way to do this?

Thanks,

Dane
John Mishefske - 28 Mar 2007 05:54 GMT
> I am building queries off of other queries in Access. The table that one of
> the first queries is retrieving info from has no data for this particular
[quoted text clipped - 5 lines]
> What I would like to do is have a process in place that will tell Access to
> substitute the null value with a number zero. Is there a way to do this?

You could test the value with the IsNull() function within the IIf() function.

Qty: IIf(IsNull([YourCountField], 0,[YourCountField])

in SQL it would look like this:

SELECT  IIf(IsNull([YourCountField], 0,[YourCountField]) As Qty ...

Signature

'---------------
'John Mishefske
'---------------

John W. Vinson - 28 Mar 2007 06:31 GMT
>What I would like to do is have a process in place that will tell Access to
>substitute the null value with a number zero. Is there a way to do this?

NZ([fieldname])

            John W. Vinson [MVP]
Reynolds Inc - 28 Mar 2007 18:52 GMT
Thanks to John Mishefske and John W. Vinson for your help!

> I am building queries off of other queries in Access. The table that one of
> the first queries is retrieving info from has no data for this particular
[quoted text clipped - 9 lines]
>
> Dane
Briciola - 03 May 2007 16:37 GMT
>I am building queries off of other queries in Access. The table that one of
> the first queries is retrieving info from has no data for this particular
[quoted text clipped - 10 lines]
>
> Dane

nz([Field-name];0)
 
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.