Data Type Mismatch?

ewong1

Eric Wong
Local time
Yesterday, 18:05
Joined
Dec 4, 2004
Messages
96
I am querying results using Access 97(Yes its old and no my company is not willing to upgrade.....:confused:). Anyhow, I am connecting to a corporate database that has two tables I am querying that should be joined on one field (wmg.wmgtk01_tnk.sys_i = wmg.wmgwo04_halfleg_actl.tnk_sys_i). I am running into a problem with these fields because they have been defined differently by my IT department. The "sys_i" field is a NUMBER of length 5, while the "tnk_sys_i" field is a NUMBER of length 20. Is there a way that I can trick Access into joining these fields even though they do not match? I am currently getting a "Data Type Mismatch" error when I attempt to create this join.

Thanks in advance for your help!
 
ewong1,

You can wrap both fields in a CLng function:

CLng(wmg.wmgtk01_tnk.sys_i) = CLng(wmg.wmgwo04_halfleg_actl.tnk_sys_i)

Wayne
 
??

So long as they are both numbers, I don't understand why this throws a data type mismatch.
 

Users who are viewing this thread

Back
Top Bottom