Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DCount Recs only for current year

Status
Not open for further replies.

rjf3123

Technical User
Sep 29, 2003
9
US
Tying to create a form that will count records in tblClientTracking where the year in the SubmitDate field is
only the current year.

This syntax is giving me #error and #headache!

=DCount("[SubmitDate]","[tblClientTracking]","DatePart('yyyy',([SubmitDate]))")

Anyone see what's wrong with this?

TIA -
R. Fisher
 
You have the DCount syntax wrong.

Should be something like

=DCount("[SubmitDate]","[tblClientTracking]","DatePart('yyyy',([SubmitDate])) = SOMETHING")


Jim DeGeorge [wavey]
 
Thanks tons Jim -

I knew I was on the right track, at least with 3 wheels. I am posting the correct function here for future seekers ...

=DCount("[SubmitDate]","[ClientTracking]","DatePart('yyyy',([SubmitDate])) = DatePart('yyyy',date())")

This works great!

R. Fisher
 
Glad to have helped, and yes, the Tek-Tip folks like to see the answers and acknowledgements that it worked. Nice going.

Jim DeGeorge [wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top