calibre74
asked on
Microsoft Access VBA - count records with date comparisons
First of all I am still a novice with Microsoft Access VBA and queries.
I am trying to work out how I can count records in a MS Access 2010 table, based on comparing a date field with today's date in an Event Procedure within a form.
Basically I have the field "app date" in a table called "tblMain"and I want to count the number of records in which the "app date" was more than 1 calendar month ago. I am assuming this uses a DCount statement but I'm not sure how to implement this.
Any help would be greatly appreciated.
I am trying to work out how I can count records in a MS Access 2010 table, based on comparing a date field with today's date in an Event Procedure within a form.
Basically I have the field "app date" in a table called "tblMain"and I want to count the number of records in which the "app date" was more than 1 calendar month ago. I am assuming this uses a DCount statement but I'm not sure how to implement this.
Any help would be greatly appreciated.
As a DCount:
DCount("[app date]", "[tblMain]", "[app date] <= #" & Date() & "#")
DCount("[app date]", "[tblMain]", "[app date] <= #" & Date() & "#")
Patrick: Your DCount doesn't cut it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Now you've covered the bases.
Open in new window