Solved

Data type mismatch

Posted on 2014-04-24
3
318 Views
Last Modified: 2014-04-25
I am trying to run the following query. I keep getting "Data Type Mismatch"

Any ideas? Thanks!

SELECT Sum(qryStatsIndividual.MessagesRecorded) AS SumOfMessagesRecorded, Sum(qryStatsIndividual.TotalNewClients) AS SumOfTotalNewClients, Sum(qryStatsIndividual.BookedTrue) AS SumOfBookedTrue, Sum(qryStatsIndividual.TalkedTo) AS SumOfTalkedTo, Sum(qryStatsIndividual.PercentBooked) AS SumOfPercentBooked, Sum(qryStatsIndividual.FiveMinCallBack) AS SumOfFiveMinCallBack, Sum(qryStatsIndividual.PercentinFive) AS SumOfPercentinFive, "ADAY" AS DateSpec, DateValue(Nz([qryStatsIndividual].[DateField],#1/1/1950#)) AS Expr1
FROM qryStatsIndividual
GROUP BY "ADAY", DateValue(Nz([qryStatsIndividual].[DateField],#1/1/1950#))
HAVING (((DateValue(Nz([qryStatsIndividual].[DateField],#1/1/1950#)))=DateValue(Now())));

Open in new window

0
Comment
Question by:cansevin
3 Comments
 
LVL 12

Expert Comment

by:pdebaets
ID: 40021841
I wonder if you might be trying to sum a text field here

Sum(qryStatsIndividual.TalkedTo) AS SumOfTalkedTo

?

If that's not it, make a copy of your query, then remove one column at a time until you find the column that is causing the problem. then check the data type of the field in that column.
0
 
LVL 45

Accepted Solution

by:
aikimark earned 500 total points
ID: 40021865
my guess would be
DateValue(Nz([qryStatsIndividual].[DateField],#1/1/1950#))

Open in new window

DateValue() expects a string parameter, but you are passing a date data type.
0
 
LVL 29

Expert Comment

by:IrogSinta
ID: 40021921
Perhaps the problem lies in the query called qryStatsIndividual.  Can you post the SQL of that one?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Title # Comments Views Activity
Help in SQL 13 37
DateAdd every year from Jun 3 24
Strategy for Reporting Crosstab Query w/ Changing Column Headings 12 40
Use after update to change dates 2 14
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

791 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