Datatype Mismatch

G

Guest

Hi All,

In a database i'm developing i am using someone else's SQL tables for some
of the core data.

However the join fields in these are different datatypes, so i can join them
in a query. I must somehow create a join here though as on there own they are
pointless.

Getting the DBA to amend the table would be the easiest option but i dont
wont to seem stupid if there is another way i can do this without getting it
changes.

The 2 fields are Number and Text, can i do anything within the query to
allow this join?

Many thanks & regards,
Dave
 
J

John Spencer

You can use the where clause to do this

SELECT *
FROM TableA, TableB
WHERE TableA.Number & "" = TableB.Text

You should also be able to do this with a join. You can only set this up in
the SQL view, you can't do this in the query design view (the grid).

SELECT *
FROM TableA INNER JOIN TableB
ON (TableA.Number & "") = TableB.Text


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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