Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UGH ! What's wrong here ?

Status
Not open for further replies.

ofird

Programmer
Jul 1, 2002
5
IL
Hi bunch,


After spending too many hours I decided to try my luck here ;-).
I am trying to run a query that calls a function which receives a date and returns an integer.
But somehow i keep getting "Data tye Mismatch".
for example:

SELECT Orders.CloseTime
FROM (Orders INNER JOIN DishesInOrder ON Orders.OrderID = DishesInOrder.OrderID) INNER JOIN Dishes ON DishesInOrder.DishID = Dishes.DishID
WHERE (((compute([Orders]![CloseTime]))=24));

The Function compute is the fucntion i was refering to. When I run the query with no comparison to 24, I get the results from "compute".

Why the mismatch? I am comparing to Integers ?!?
 
You've got me stumped - I created a copy of your query and a dummy "compute" function and it works just fine, even if I put "24" (text) instead of 24 (number) in the criterion.

Look carefully at the results you get without the 24 comparison - are there any nulls or unusual values returned in the date or compute columns?

Do you really need a VBA function? can you get the same result with an expression using built-in functions?

Good luck,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top