Solved

Using DSum and Date Parameters in a Query Together

Posted on 2004-04-26
4
592 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 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
Familiarize people with the process of utilizing SQL Server functions 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 Ac…

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now