Filter Current Month Records in Report

V

VBAfan

I have a report that needs to display the total records of current Month
(table have all year records)from Table name "Audits", the field cointaining
the date records is "Date". How can I write an expression in a textbox to
show this tota in the report?l, or how can I do this in VBA (recordset).
 
K

KARL DEWEY

You should not name your date field 'Date' as it is a reserved word and may
cause problems.
To your request - create a calculated field like this ---
Year_Mon: Format([YourDateField], "yyyymm")
Then use this as criteria for current month ---
Format(Date(), "yyyymm")
Criteria for last month ---
Format(DateAdd("m",-1,Date()), "yyyymm")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top