PC Review


Reply
Thread Tools Rate Thread

Count Nulls & Not Nulls in Reports

 
 
RoadKill
Guest
Posts: n/a
 
      26th Jul 2008
I am trying to figure out how to count the Null values and Not Null values in
a field in a report.

We'll just call it Field3 of Query1 of Report1.

Thank you
 
Reply With Quote
 
 
 
 
John Spencer
Guest
Posts: n/a
 
      27th Jul 2008
In a control in the report footer set the control source to

To Count not nulls all you need is the following. Count counts any
value that is not null and does not count Null values.
=Count(Field3)

To Count Nulls you can test if the field is null and return a value if
so, otherwise return null if there is already a value
=Count(IIF(Field3 is Null,1,Null))

Or count nulls using the following.
=Count(*) - Count(Field3)

Count(*) counts all the records and then you subtract the records that
have a value in field3

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


RoadKill wrote:
> I am trying to figure out how to count the Null values and Not Null values in
> a field in a report.
>
> We'll just call it Field3 of Query1 of Report1.
>
> Thank you

 
Reply With Quote
 
RoadKill
Guest
Posts: n/a
 
      28th Jul 2008
Great, thanks John!

"John Spencer" wrote:

> In a control in the report footer set the control source to
>
> To Count not nulls all you need is the following. Count counts any
> value that is not null and does not count Null values.
> =Count(Field3)
>
> To Count Nulls you can test if the field is null and return a value if
> so, otherwise return null if there is already a value
> =Count(IIF(Field3 is Null,1,Null))
>
> Or count nulls using the following.
> =Count(*) - Count(Field3)
>
> Count(*) counts all the records and then you subtract the records that
> have a value in field3
>
> '====================================================
> John Spencer
> Access MVP 2002-2005, 2007-2008
> The Hilltop Institute
> University of Maryland Baltimore County
> '====================================================
>
>
> RoadKill wrote:
> > I am trying to figure out how to count the Null values and Not Null values in
> > a field in a report.
> >
> > We'll just call it Field3 of Query1 of Report1.
> >
> > Thank you

>

 
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
Totals Won't Count Nulls jgraves Microsoft Access Queries 1 7th Jan 2010 06:17 PM
Count of rows with nulls tbmarlie Microsoft Excel Programming 1 22nd Oct 2007 09:40 PM
Using Count in a Report with Nulls =?Utf-8?B?YXJpYQ==?= Microsoft Access 1 13th Sep 2005 10:34 PM
Need to Count Nulls marywoody Microsoft Access Queries 1 22nd Jan 2004 09:27 AM
Count nulls Razor Microsoft Access Queries 1 9th Dec 2003 02:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:19 AM.