|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
INNER JOIN query trouble with null join fields
Ok the query I have below works great till I come acrossed a record that does not have a ClientNumber (Meaning it is blank). So in effect what it does is even if the Where clause is satisfied in a record with no ClientNumber it skips it. What I need is a way to include records from the myProject table even if they do not have a ClientNumber for an INNER JOIN. I am thinking this is going to have to be some sort of Nested query or something. My brain hurts from other parts of this project so I am asking it here.
SELECT myProject.*, myClients.* FROM myProject INNER JOIN myClients ON myProject.ClientNumber = myClients.ClientNumber WHERE (myProject.ProjectName LIKE '%IPDG3%') OR (myProject.ClientCompanyB LIKE '%IPDG3%') ORDER BY myProject.ProjectNumber
__________________
George - www.ipdg3.com Helping Developers and Programmers Find Resources Forums - Contests - Tutorials - Source Code ORB - Wireless Site - Online Gear |
|
#2
|
|||
|
|||
|
Use a left join instead of an inner join
__________________
FSBO (For Sale By Owner) Realty |
|
#3
|
|||
|
|||
|
Thanks rod k been so busy on other parts of this program that I was just drawing a blank. New query in case people want to see the fix.
SELECT myProject.*, myClients.* FROM myProject LEFT OUTER JOIN myClients ON myProject.ClientNumber = myClients.ClientNumber WHERE (myProject.ProjectName LIKE '%IPDG3%') OR (myProject.ClientCompanyB LIKE '%IPDG3%') ORDER BY myProject.ProjectNumber And that is how "rod k" made the "WHOIS the Man" list folks *Grin* Thanks |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > INNER JOIN query trouble with null join fields |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|