A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Count null fields



 
 
Thread Tools Display Modes
  #1  
Old January 18th, 2009, 11:07 PM posted to microsoft.public.access.gettingstarted
steve goodrich
external usenet poster
 
Posts: 132
Default Count null fields

I have a form that I would like to add a text box to that will count how
many null entries there are in a given field

I don't know how to enter the text.

=count(*) will count all the records but how would I count all the null
entries in a field called 'Approved'

Thanks in advance for any help

Steve Goodrich


  #2  
Old January 19th, 2009, 12:03 AM posted to microsoft.public.access.gettingstarted
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Count null fields

=Sum(IIf(IsNull([Approved]), 1, 0)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Steve Goodrich" wrote in message
. ..
I have a form that I would like to add a text box to that will count how
many null entries there are in a given field

I don't know how to enter the text.

=count(*) will count all the records but how would I count all the null
entries in a field called 'Approved'

Thanks in advance for any help

Steve Goodrich



  #3  
Old January 19th, 2009, 01:12 AM posted to microsoft.public.access.gettingstarted
Clifford Bass[_2_]
external usenet poster
 
Posts: 1,295
Default Count null fields

Hi Steve,

Or, to make it slightly shorter, you can take advantage of the fact
that true is represented by a -1 and use:

=-Sum(IsNull([Approved]))

or

=Sum(-IsNull([Approved]))

Clifford Bass

"Douglas J. Steele" wrote:

=Sum(IIf(IsNull([Approved]), 1, 0)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

  #4  
Old January 19th, 2009, 10:40 AM posted to microsoft.public.access.gettingstarted
steve goodrich
external usenet poster
 
Posts: 132
Default Count null fields

Thanks Guys, Works perfectly.

"Steve Goodrich" wrote in message
. ..
I have a form that I would like to add a text box to that will count how
many null entries there are in a given field

I don't know how to enter the text.

=count(*) will count all the records but how would I count all the null
entries in a field called 'Approved'

Thanks in advance for any help

Steve Goodrich



  #5  
Old January 19th, 2009, 03:04 PM posted to microsoft.public.access.gettingstarted
Clifford Bass[_2_]
external usenet poster
 
Posts: 1,295
Default Count null fields

You are welcome Steve.

Clifford Bass

"Steve Goodrich" wrote:

Thanks Guys, Works perfectly.

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.