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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DCount using Between

Status
Not open for further replies.

TammyT

Programmer
Sep 17, 2003
183
US
I need to count records in a query 2 ways.

1) All records in the query that have a review date after 7/1/06 - not a problem, I got that DCount formula in & working.

2) Those records from the query where the review date is between 2 dates, & those 2 dates are found on a form (the form that opens the report) - I can't figure out how to add the "between" function to the DCount - or can't this be done?

Thanks!
 
You can try:
DCount("*","qryNoName","ReviewDate Between #" & Forms!frmNoName!txtStart & "# AND #" & Forms!frmNoName!txtEnd & "#")

If the query is the report's record source then you can probably count using a more efficient method.


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
It's giving me an invalid syntax error - I'm thinking it has something to do with the order of the #, &, and " - Yes?
 
Nevermind - it works - I just had to refer it to the table, not the query - go figure!

As always - you guys are the best!

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top