Number to Number "Data Type Mismatch in Expression" in Join

E

excelCPA

I am attempting to write a query joining two linked tables in a query
by payroll number (all numeric). When write the query and join by
payroll number I get the "Data Type Mismatch in Expression" error.

Both tables have the Data Type as "Number", but the only difference I
can tell is one has "Field Size" as "Decimal" and the other has "Field
Size" as "Double".

I have even tried to join on the VAL() of each payroll number field
with no luck. Any ideas?
 
R

Roger Carlson

"Decimal" and "Double" are actually different datatypes. The table design
UI is confusing on that point.

I'm curious why a payroll number would be either decimal or double. Long
Integer is my preferred datatype for ID numbers. If you can, the best thing
to do is change the field in both tables to the same datatype.

If you can't, try the cLng() function which will convert the numbers to long
integer. However, by adding the function to the Join clause, you won't be
able to go back to the design view.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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