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 / Modules / DAO / VBA / March 2008

Tip: Looking for answers? Try searching our database.

Criteria in a DCount Function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Del - 05 Mar 2008 17:15 GMT
I'm trying to count missing dates in the [CalDue] field of the table tblCal.  
It seems that the following code should work but it always yields a zero
count.

DCount("[CalDue]", "tblCal", "IsNull([CalDue])")
Signature

Thank you,
Del

Douglas J. Steele - 05 Mar 2008 18:30 GMT
From the Help file:

"The DCount function doesn't count records that contain Null values in the
field referenced by expr, unless expr is the asterisk (*) wildcard
character. If you use an asterisk, the DCount function calculates the total
number of records, including those that contain Null fields."

Try:

DCount("*", "tblCal", "IsNull([CalDue])")

Signature

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

> I'm trying to count missing dates in the [CalDue] field of the table
> tblCal.
> It seems that the following code should work but it always yields a zero
> count.
>
> DCount("[CalDue]", "tblCal", "IsNull([CalDue])")
fredg - 05 Mar 2008 18:35 GMT
> I'm trying to count missing dates in the [CalDue] field of the table tblCal.  
> It seems that the following code should work but it always yields a zero
> count.
>
> DCount("[CalDue]", "tblCal", "IsNull([CalDue])")

[CalDue] is the name of a Date datatype field?
Try it this way:

=DCount("*","tblCal","IsNull([CalDue])")
or
=DCount("*","tblCal","[CalDue] is Null")
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Marshall Barton - 05 Mar 2008 18:38 GMT
>I'm trying to count missing dates in the [CalDue] field of the table tblCal.  
>It seems that the following code should work but it always yields a zero
>count.
>
>DCount("[CalDue]", "tblCal", "IsNull([CalDue])")

DCount("*", "tblCal", "CalDue Is Null")

Signature

Marsh
MVP [MS Access]

Del - 05 Mar 2008 19:26 GMT
Thanks to all,
Signature

Thank you,
Del

> I'm trying to count missing dates in the [CalDue] field of the table tblCal.  
> It seems that the following code should work but it always yields a zero
> count.
>
> DCount("[CalDue]", "tblCal", "IsNull([CalDue])")
 
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.