View Full Version : Type Mismatch


Mattymatt79
05-14-2002, 06:08 AM
Im trying a query here and I keep getting a type mismatch. Whenever I take out the MRNO table and fields that I want from it it works fine but as soon as I put that in I get the error...

This is the SQL code if this helps
SELECT MAININFO.LAST, MAININFO.FIRST, MAININFO.MI, MAININFO.SSN, PAYGRADES.PayGrade, MAININFO.MRNO, MRNO.MRNO, MRNO.STATUS
FROM MRNO RIGHT JOIN (PAYGRADES INNER JOIN MAININFO ON PAYGRADES.PayGrade = MAININFO.PAYGRADE) ON MRNO.MRNO = MAININFO.MRNO
ORDER BY MAININFO.PAYGRADE DESC , MAININFO.LAST;

Mattymatt79
05-14-2002, 06:14 AM
Im thinking it has something to do with my MRNO table.
I cant do an update query either. Any Info would be GREATLY appreciated

Pat Hartman
05-14-2002, 10:51 AM
Is the MRNO field defined with the same data type in both tables?

BTW, you should avoid using the names of functions or properties as column names. First and Last are both function names.

Mattymatt79
05-15-2002, 03:30 AM
no pat, MRNO in the actual table MRNO is an autonumber, in the main table it is text... I took your advice and changed the fields of last and first to LastName and FirstName, didnt change a thing though
any suggestions?

Pat Hartman
05-15-2002, 07:36 AM
You can't join two fields of unlike datatypes. Since MRNO is an autonumber in the MRNO table it must be defined as long in MAININFO.

Mattymatt79
05-15-2002, 09:07 AM
Thanks So much... I didnt realize in the thing that I did before with the same fields that it was autonumber and number as soon as you wrote that I checked and you are SO right.
thanks again for the help