PC Review


Reply
Thread Tools Rate Thread

Blank Fields in NOT Null Query Criteria

 
 
Steve Stad
Guest
Posts: n/a
 
      27th May 2010
Why would a few blank fields show up in a query where I am using 'Is Not
Null' in the criteria. The rest of the Nulls are filtered out - but there
are 7 blank fields showing up. I went in to the table and hit delete in each
of the 7 fields but they still show up in the query results.
 
Reply With Quote
 
 
 
 
Jerry Whittle
Guest
Posts: n/a
 
      27th May 2010
There are four things that can cause a 'blank' field. Nulls as you already
surmised.

Next come Zero Length Strings. Basically they are just "". That is a text
string with nothing in it. Technically they are different than a null as null
means that you don't know what goes there whereas a ZLS means nothing goest
there.

Then there are non-printable ASCII characters. One would be a paragraph
return or end of line character.

Lastly there are plain old spaces. Something like might look blank, but
isn't.

When confonted with an empty looking field that isn't working as expected, I
check the data with queries looking for things such as Like " *" ; Null; and
"" .
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Steve Stad" wrote:

> Why would a few blank fields show up in a query where I am using 'Is Not
> Null' in the criteria. The rest of the Nulls are filtered out - but there
> are 7 blank fields showing up. I went in to the table and hit delete in each
> of the 7 fields but they still show up in the query results.

 
Reply With Quote
 
KARL DEWEY
Guest
Posts: n/a
 
      27th May 2010
A Null is not the same as a 'blank' field. A Null is like a vacuum. If you
add something to a Null the results is Null. Adding something to a blank
gives you the something.

A 'blank' is also known as a zero-lenght string. If you are updating a text
field to remove all data there two ways - replace with a Null or two double
quotes. The two double quotes comprises a zero-lenght string.

Criteria to not show record in either case --
Is Not Null AND <>""

--
Build a little, test a little.


"Steve Stad" wrote:

> Why would a few blank fields show up in a query where I am using 'Is Not
> Null' in the criteria. The rest of the Nulls are filtered out - but there
> are 7 blank fields showing up. I went in to the table and hit delete in each
> of the 7 fields but they still show up in the query results.

 
Reply With Quote
 
Steve Stad
Guest
Posts: n/a
 
      28th May 2010
Jerry/Karl,

Thank you for replies. The blanks show up using Like "" in qry criteria.
Is there a way to replace these blanks (or ZLS) with something to make it
NULL.

"KARL DEWEY" wrote:

> A Null is not the same as a 'blank' field. A Null is like a vacuum. If you
> add something to a Null the results is Null. Adding something to a blank
> gives you the something.
>
> A 'blank' is also known as a zero-lenght string. If you are updating a text
> field to remove all data there two ways - replace with a Null or two double
> quotes. The two double quotes comprises a zero-lenght string.
>
> Criteria to not show record in either case --
> Is Not Null AND <>""
>
> --
> Build a little, test a little.
>
>
> "Steve Stad" wrote:
>
> > Why would a few blank fields show up in a query where I am using 'Is Not
> > Null' in the criteria. The rest of the Nulls are filtered out - but there
> > are 7 blank fields showing up. I went in to the table and hit delete in each
> > of the 7 fields but they still show up in the query results.

 
Reply With Quote
 
Steve Stad
Guest
Posts: n/a
 
      28th May 2010
Actually I was able to replace the ZLS records with text and then deleted the
text and now they are true NULLS.

"Steve Stad" wrote:

> Jerry/Karl,
>
> Thank you for replies. The blanks show up using Like "" in qry criteria.
> Is there a way to replace these blanks (or ZLS) with something to make it
> NULL.
>
> "KARL DEWEY" wrote:
>
> > A Null is not the same as a 'blank' field. A Null is like a vacuum. If you
> > add something to a Null the results is Null. Adding something to a blank
> > gives you the something.
> >
> > A 'blank' is also known as a zero-lenght string. If you are updating a text
> > field to remove all data there two ways - replace with a Null or two double
> > quotes. The two double quotes comprises a zero-lenght string.
> >
> > Criteria to not show record in either case --
> > Is Not Null AND <>""
> >
> > --
> > Build a little, test a little.
> >
> >
> > "Steve Stad" wrote:
> >
> > > Why would a few blank fields show up in a query where I am using 'Is Not
> > > Null' in the criteria. The rest of the Nulls are filtered out - but there
> > > are 7 blank fields showing up. I went in to the table and hit delete in each
> > > of the 7 fields but they still show up in the query results.

 
Reply With Quote
 
KARL DEWEY
Guest
Posts: n/a
 
      28th May 2010
Deleting text makes them zero lenght strings, not nulls.
Use an update query to either have all nulls or zero lenght strings.

Update To: Null
Criteria: ""

Or --
Update To: ""
Criteria: Is Null


--
Build a little, test a little.


"Steve Stad" wrote:

> Actually I was able to replace the ZLS records with text and then deleted the
> text and now they are true NULLS.
>
> "Steve Stad" wrote:
>
> > Jerry/Karl,
> >
> > Thank you for replies. The blanks show up using Like "" in qry criteria.
> > Is there a way to replace these blanks (or ZLS) with something to make it
> > NULL.
> >
> > "KARL DEWEY" wrote:
> >
> > > A Null is not the same as a 'blank' field. A Null is like a vacuum. If you
> > > add something to a Null the results is Null. Adding something to a blank
> > > gives you the something.
> > >
> > > A 'blank' is also known as a zero-lenght string. If you are updating a text
> > > field to remove all data there two ways - replace with a Null or two double
> > > quotes. The two double quotes comprises a zero-lenght string.
> > >
> > > Criteria to not show record in either case --
> > > Is Not Null AND <>""
> > >
> > > --
> > > Build a little, test a little.
> > >
> > >
> > > "Steve Stad" wrote:
> > >
> > > > Why would a few blank fields show up in a query where I am using 'Is Not
> > > > Null' in the criteria. The rest of the Nulls are filtered out - but there
> > > > are 7 blank fields showing up. I went in to the table and hit delete in each
> > > > of the 7 fields but they still show up in the query results.

 
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
QUERY criteria dependent on Is null do A, not is null do B BlueWolverine Microsoft Access Queries 6 13th Jun 2008 02:23 PM
Fill null fields from last non-null record - No update query pleas mattsmom Microsoft Access 2 2nd Apr 2008 01:56 PM
query search for 'is not null' produces null fields. why? =?Utf-8?B?TWlrZTMz?= Microsoft Access Queries 5 22nd Dec 2005 03:23 AM
Problems - Query does not filter blank fields with IS NULL Maik Microsoft Access 1 6th Jun 2005 10:54 AM
Crosstab query - how can I pull out blank or null fields? chrisb Microsoft Access Queries 1 29th Jul 2003 02:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:18 AM.