query error "Data type mismatch in criteria expression" on sum

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
 
A

Allen Browne

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.
 
I

Igor Barbaric

Hello, Allen and everyone else!
It was not my intention to annoy anyone. I am completely new to these
forums (this is my first attempt - from Google Groups) and don't know
how they function. I was trying to correct my postings since I thought
they were not clear enough. I "improved" the subject line too, and this
is why you saw them different. Since there was no option to change post
(or I didn't see it), I deleted the posts and created them again, and
thought it was okay. Obviously you (or someone else too) answered the
posts before I deleted them.
I appologize for this sincerely, and if it's of any worth to you: thank
you for your answer, although I didn't see the answer at all (it's
deleted with initial postings).
I am sorry that I made you so angry and I can only hope that your anger
will not persist. If you decide to forgive me, I'd like to ask you to
repeat your answer.
Thanks in advance!
Kind regards,
Igor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top