data type mismatch in criteria selection

G

Guest

This query used to work, but quit about a week ago. I can't track any
software change, and it now fails on all computers that run it.

I'm calculating the # of work hours (8.5 hrs/workday) from the time a job is
started until Now() to identify it's age in hours. The following calculation
works fine.

Elapsed: 8.5*(DateDiff("d",[Date of
Entry],Date()))+24*(TimeValue(Now())-TimeValue([Call Received
Time]))+17*DateDiff("ww",Now(),[date of entry])

It takes 8.5 * the number of days from when it started to today. Then adds
the number of hours between the time it started and now. Then it subtracts
17 hrs for each weekend. This calculation works correctly.

I can run the query and it looks good. However, when I try to select only
records where the [Elapsed] is in some range, the query fails with a data
type mismatch.

For example: Between 8 and 8.5
or <8
or any other numeric range.

What am I doing wrong? I tried putting the selection criteria in another
query that takes its dataset from the first query, but that fails the same
way.

Thanks
 
J

Jeff Boyce

You may need to explicitly cast the results of your calculations into a data
type. Since you are comparing with 8 or 8.5, may I suggest using something
like:

Elapsed: CCur(8.5*(DateDiff... what you said ...
 

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