Solved

Using DSum and Date Parameters in a Query Together

Posted on 2004-04-26
4
602 Views
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!

eaglecmg
0
Comment
Question by:eaglecmg
[X]
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
4 Comments
 
LVL 17

Accepted Solution

by:
walterecook earned 250 total points
ID: 10919241
Try wrapping the dates in #
#4/30/2004#

Walt
0
 
LVL 54

Assisted Solution

by:nico5038
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"

Nic;o)
0
 
LVL 17

Expert Comment

by:walterecook
ID: 10919401
well done Nico.
Nice pickup.
0
 

Author Comment

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

eaglecmg
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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.

752 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