Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using DSum and Date Parameters in a Query Together

Posted on 2004-04-26
4
Medium Priority
?
617 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
  • 2
4 Comments
 
LVL 17

Accepted Solution

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

Walt
0
 
LVL 54

Assisted Solution

by:nico5038
nico5038 earned 1000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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.

926 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