Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Left outer\inner join type mismatch

Status
Not open for further replies.

SQLScholar

Programmer
Joined
Aug 21, 2002
Messages
2,127
Location
GB
Hey all,

I have a query (below)

Code:
SELECT REP_PEOPLE.PERSON_CODE, REP_PEOPLE.FORENAME, REP_PEOPLE.MIDDLE_NAMES, REP_PEOPLE.SURNAME, StudentsWithID.studentid, StudentsWithID.First, StudentsWithID.Last, StudentsWithID.[E-mail address], StudentsWithID.Alias
FROM REP_PEOPLE LEFT JOIN StudentsWithID ON REP_PEOPLE.PERSON_CODE = StudentsWithID.studentid;

Where if its an inner join it works fine, but (as above) where it is a left outer it then returns a type mismatch.

Can anyone help by answering why? If i know why i might be able to fix it.

Dan

----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Dr. Seuss

Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
 
Are the fields that you are joining on the same data type: Both are text or both are number? If not, then in your query you could use a function to convert one to the other.

For example, if Person_code is text and studenid is number, do this:

val(REP_PEOPLE.PERSON_CODE) = StudentsWithID.studentid;
 
but surely that would cause the same error with the inner join as it would with a left outer?

This is only erroring if i leave it as left outer.

----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Dr. Seuss

Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top