Using DSum and Date Parameters in a Query Together

Posted on 2004-04-26
Last Modified: 2006-11-17
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!

Question by:eaglecmg
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 17

Accepted Solution

walterecook earned 250 total points
ID: 10919241
Try wrapping the dates in #

LVL 54

Assisted Solution

nico5038 earned 250 total points
ID: 10919388
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"

LVL 17

Expert Comment

ID: 10919401
well done Nico.
Nice pickup.

Author Comment

ID: 10919749
Thanks to both of you it worked great!   I appreciate the help!


Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question