Using DSum and Date Parameters in a Query Together

Good morning!

I have the following query that is subtracting two fields based on date criteria.  I am getting a data type mismatch error.  Can you please advise how to correct this error.


Subtraction: DSum("[Number of Personnel Assigned] - [Number of Personnel Attended]","Query By Month","[Date of Meeting] >='4/1/2004' and [Date of Meeting] <='4/30/2004'")

Thanks is advance for your assistance!

eaglecmg
eaglecmgAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
walterecookConnect With a Mentor Commented:
Try wrapping the dates in #
#4/30/2004#

Walt
0
 
nico5038Connect With a Mentor Commented:
Walter is "right on the money", but would like to add that using BETWEEN is faster, try:
"[Date of Meeting] BETWEEN #4/1/2004# AND #4/30/2004#"

Between dates are so-called "inclusive"

Nic;o)
0
 
walterecookCommented:
well done Nico.
Nice pickup.
0
 
eaglecmgAuthor Commented:
Thanks to both of you it worked great!   I appreciate the help!

eaglecmg
0
All Courses

From novice to tech pro — start learning today.