If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Number to Number "Data Type Mismatch in Expression" in Join
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? |
#2
|
|||
|
|||
Number to Number "Data Type Mismatch in Expression" in Join
"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/...UBED1=ACCESS-L "excelCPA" wrote in message ... 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? |
Thread Tools | |
Display Modes | |
|
|