error Data type mismatch in criteria expression on sum

  • Thread starter Thread starter Igor Barbaric
  • Start date Start date
I

Igor Barbaric

Hello!
I get error message "Data type mismatch in criteria expression" when I
try to run sum on "Single" field.

I have created a very simple query like this:

SELECT Tasks.Name, DurationHrs([Log.DateTimeFrom],[Log.DateTimeTo]) AS
Duration
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
this:

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
3464)".

What could possibly be wrong?
Thanks in advance!
Kind regards,
Igor
 
Igor you have posted this twice in another group and 3 times here.

This is clearly intentional (subject lines are different), so it looks like
you are trying to annoy everyone.

I am sorry I answered your post in comp.databases.ms-access, and will try
not to give you answers in future.
 
Back
Top