SQL Type Mismatch

D

drew poulson

I have the following sql statement

SELECT UTADBA_PARCEL.PARCEL_ID, UTADBA_PARCEL.LINK_ID
FROM Serial INNER JOIN UTADBA_PARCEL ON Serial.[Parcel ID] = UTADBA_PARCEL.PARCEL_ID;

I know that it is a type mismatch because Serial.[Parcel ID] is a number and UTADBA_PARCEL.PARCEL_ID is a text

I wrote all of this using tables on my database and it worked fine, but i had to switch them out for link tables before it could be used. I know that there is a way to put quotes around a part to make it function as text, i don't know how or where though. I tried putting quotes on like this

SELECT UTADBA_PARCEL.PARCEL_ID, UTADBA_PARCEL.LINK_ID
FROM Serial INNER JOIN UTADBA_PARCEL ON "Serial.[Parcel ID]" = UTADBA_PARCEL.PARCEL_ID;

this is the only way it does not give me a syntax error but it does say "JOIN expression not supported"

If anyone could help me with this it would be greatly appreciated.
 
A

Allen Browne

The best solution would be to open the table in design view and change it to
Number of the same size (long integer?) so they match.

If that is not possible, you may be able to workaround it with something
like this:

SELECT UTADBA_PARCEL.PARCEL_ID,
UTADBA_PARCEL.LINK_ID
FROM Serial INNER JOIN UTADBA_PARCEL
ON Serial.[Parcel ID] = CLng(Val(Nz(UTADBA_PARCEL.PARCEL_ID,0)));
 

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