View Full Version : Date ranges while using DCount


jadefury
03-02-2010, 09:25 AM
I am currently using this on the report which is attached to my query:

=DCount("[Patient Type:]","metroQ","[Patient Type:]='Level 1 Care Coordination'")

and this is working correctly. However if I add this to my query so that you can manually enter the date for the report I get #error on the report.

Between [Enter Date 1] And [Enter Date 2]

The Query works fine as a stand alone and the Report works as a stand alone. I guess my question is is there something I can add just to the Dcount expression that acts like the above query where the dates can be manually entered each time the report is ran?

Thanks in advance!

SOS
03-02-2010, 10:44 AM
Use a FORM for input and then you can refer to the form text boxes (as long as the form remains open) at any time and in both the queries and the dcount.

c_smithwick
03-04-2010, 04:11 PM
Try this (I assume here that your date field is named fldDate=DCount("[Patient Type:]","metroQ","([Patient Type:]='Level 1 Care Coordination') AND ([fldDate] BETWEEN #" & InputBox("Enter Date 1") & "# AND #" & InputBox("Enter Date 2") & "#)")