By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,753 Members | 2,071 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,753 IT Pros & Developers. It's quick & easy.

Sum query: Data type mismatch in criteria expression

P: n/a
I have created a very simple query like this:

SELECT Tasks.Name, DurationHrs([Log.DateTimeFrom],[Log.DateTimeTo]) AS
FROM Tasks INNER JOIN Log ON Tasks.TaskID=Log.TaskID;

The above query works fine. "Tasks.Name" is a "Text" field with
description of task, while "DurationHrs" is a VB function that
calculates number of hours between two "DateTime" values and returns
result of type "Single".

However, when I try to sum these hours of type "Single" in a query like

SELECT Tasks.Name,
Sum(DurationHrs([Log.DateTimeFrom],[Log.DateTimeTo])) AS Duration
FROM Tasks INNER JOIN Log ON Tasks.TaskID = Log.TaskID
GROUP BY Tasks.Name;

.... I get an error "Data type mismatch in criteria expression. (Error

What could possibly be wrong?
Thanks in advance!
Kind regards,

Jan 27 '06 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Answered in your post 7 minutes earlier.
Jan 27 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.