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 / General 2 / March 2007

Tip: Looking for answers? Try searching our database.

Compare Query - doesn't show if null

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bonnie - 29 Mar 2007 20:32 GMT
Hi,

I am trying to run a query that checks one table against another.  For
instance if the address field in table two doesn't match the address field in
table one - I would like the query to return the record (<> table1.address).  
It works unless table.address is null.  Any one know why or how to force it
to show a null value as a non-match?

Thanks,

Bonnie
DBS - 29 Mar 2007 21:18 GMT
One of the counter-intuitive things with data is that a blank string is not
the same thing as a null is not the same thing as a zero...

To allow for nulls, try using the Nz function. It works by substituting a
value if it finds a null. For instance:

Nz(table1.address,"BLANK") <> Nz(table1.address,"BLANK")

(The "BLANK" is only there for emphasis. I generally use an empty string: "")

Hope that helps!

David

> Hi,
>
[quoted text clipped - 7 lines]
>
> Bonnie
Bonnie - 29 Mar 2007 21:26 GMT
Thanks David, that's what I need.  

Bonnie

> One of the counter-intuitive things with data is that a blank string is not
> the same thing as a null is not the same thing as a zero...
[quoted text clipped - 21 lines]
> >
> > Bonnie
 
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.