View Full Version : What am I doing wrong?


jstroh
10-03-2001, 09:01 AM
In my personnel data base I want to run a report based on the completed levels of training. I have 2 tables. 1 has all the employee information including the Job number. The other table has the Job information. I want the query to show all the training information including the job number, then I want the query to get the corresponding Account Name that is assigned from the job number. When I set it up in the query design view I open both tables and select the fields I want. Then I try to run the query and it gives me a "Type mismatch in JOIN expression" error message. This has happened a few times for other queries and reports that I want to run and I can't figure out why I keep getting this message. Can anyone help?

The JobNumber and AccountName correspond.
Here is the SQL:

SELECT [Personnel Information].JobNumber, [Account Information].AccountName, [Personnel Information].[Employee#], [Personnel Information].EmployeeLast, [Personnel Information].Level2, [Personnel Information].Level3, [Personnel Information].Status
FROM [Account Information] INNER JOIN [Personnel Information] ON [Account Information].JobNumber = [Personnel Information].JobNumber
WHERE ((([Personnel Information].Status)="Active"));

arickards
10-03-2001, 09:14 AM
Make sure the field types for the joined fields are the same.

jstroh
10-03-2001, 01:43 PM
In reading my SQL up above they look the same to me. Can you find a discrepency?

Alexandre
10-03-2001, 02:48 PM
Beware
The field TYPE is not the field NAME.
It would seem that the field JobNumber in your table Account Information is not of the same (or compatible) type than the field JobNumber in your table Personnel Information. Check the types of these field in table design view.

Alex

[This message has been edited by Alexandre (edited 10-03-2001).]

jstroh
10-03-2001, 03:11 PM
That was it, thank you. All my problems from that is fixed.