Returning results from non-existing entries

lxh

Registered User.
Local time
Today, 14:01
Joined
Feb 26, 2004
Messages
43
Hi there

This is my SQL select line

Code:
MySQL = "SELECT ProjectDetails.*, TeamMemberInformation.* " & _
    "FROM ProjectDetails INNER JOIN TeamMemberInformation ON " & _
    "ProjectDetails.ProjectDetailsID = TeamMemberInformation.ProjectDetailsID WHERE "

I am using it to perform a search on the project details and teammember information tables. My problem is that if there is no corresponding entry in the teammember table (for said project) then the search does not return the prpject details. Is there a way to return the project details even if there is no entry in the teammeberinformation table? - something like the Nz() function?

Thanks
Lex
 
change INNER JOIN to LEFT JOIN.
 
Result!

Kodo said:
change INNER JOIN to LEFT JOIN.

Does exactly what it should do
- but why?

Thanks
Lex
 
lxh said:
Does exactly what it should do
- but why?

INNER JOIN only selects records between tables where they both share a value

OUTER JOINS select all records from one table and only those records from the other table that match
 

Users who are viewing this thread

Back
Top Bottom