A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old December 4th, 2009, 06:54 PM posted to microsoft.public.access.queries
excelCPA
external usenet poster
 
Posts: 18
Default 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  
Old December 4th, 2009, 07:46 PM posted to microsoft.public.access.queries
Roger Carlson
external usenet poster
 
Posts: 824
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:37 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.