PC Review


Reply
Thread Tools Rate Thread

Compare Query - doesn't show if null

 
 
=?Utf-8?B?Qm9ubmll?=
Guest
Posts: n/a
 
      29th Mar 2007
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?REJT?=
Guest
Posts: n/a
 
      29th Mar 2007
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


"Bonnie" wrote:

> 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

 
Reply With Quote
 
=?Utf-8?B?Qm9ubmll?=
Guest
Posts: n/a
 
      29th Mar 2007
Thanks David, that's what I need.

Bonnie

"DBS" wrote:

> 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
>
>
> "Bonnie" wrote:
>
> > 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Show zeros for null in crosstab query KrispyData Microsoft Access Getting Started 1 16th Mar 2010 06:37 PM
Is Not Null Doesn't work in my query Denise Microsoft Access Forms 5 29th Jan 2010 05:05 PM
Show null values in query =?Utf-8?B?Sm9obg==?= Microsoft Access Queries 0 28th Mar 2007 02:18 AM
RE: Show null values in query =?Utf-8?B?T2ZlciBDb2hlbg==?= Microsoft Access Queries 0 27th Mar 2007 11:31 PM
Show null in Select Query. jenn.semo@gmail.com Microsoft Access Queries 2 13th Jul 2006 02:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:38 PM.