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 / Forms / July 2007

Tip: Looking for answers? Try searching our database.

Count() for Dates

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Please Help - 02 Jul 2007 16:00 GMT
Good morning,

I have a date field and a Count() field on my form.  The Count() field will
count the number of records of the date field being populated by the users on
the form.  

I use the formula "Count([Date Field])", and it does not seem to work.  For
example, I have 10 records on the form.  If I enter a date on one of 10
records, the count field would show 1.  

Thanks.
Klatuu - 02 Jul 2007 17:02 GMT
fields with Null values are excluded in the Count function.
Signature

Dave Hargis, Microsoft Access MVP

> Good morning,
>
[quoted text clipped - 7 lines]
>
> Thanks.
John W. Vinson - 02 Jul 2007 18:36 GMT
>Good morning,
>
[quoted text clipped - 7 lines]
>
>Thanks.

You're misunderstanding. Count does not count dates. It counts Records, in the
query in which you're using it. If you have Count([any field name]) or
Count(*) as just a calculated field in a query, the result will be 1 - that
very record.

It's not clear what you want to count. Do you want to count all of the records
in the table upon which the form is based? All of the records entered by this
user? all of the records entered by THIS user on THIS form during this
session? If so, what's the recordsource for the form?

            John W. Vinson [MVP]
Please Help - 02 Jul 2007 19:16 GMT
Thanks both of you for your responses.  

I want the count field to count the records of populated date fields.  When
the users enter a date in that date field on a form, it should count as 1.

Now I think it's working.  For some reason, it wasn't working when I posted
the message.  

Thanks again.

> >Good morning,
> >
[quoted text clipped - 19 lines]
>
>              John W. Vinson [MVP]
Klatuu - 02 Jul 2007 19:22 GMT
Count([Date Field])",

=Count("*","RecordSetName","[Date Field] Is Not Null")

Signature

Dave Hargis, Microsoft Access MVP

> Thanks both of you for your responses.  
>
[quoted text clipped - 29 lines]
> >
> >              John W. Vinson [MVP]
John W. Vinson - 02 Jul 2007 20:32 GMT
>Count([Date Field])",
>
>=Count("*","RecordSetName","[Date Field] Is Not Null")

Typo there, Dave? I think that should be =DCount("*", ...

            John W. Vinson [MVP]
 
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



©2009 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.