Skip to Content
Former Member
Jun 26, 2012 at 09:01 PM

Query all BP's without specific Activities


I'm attempting to query our database to narrow down BP's that do not have specific activities defined by activity type. However when I run a simple LEFT JOIN for the OCRD to the OCLG table it is only returning BP's with activities that meet the criteria the same as an INNER JOIN. Any ideas why this is occurring? Here's a simple query I used for testing.

SELECT T0,[CardCode], T0.[CardName], T1.[ClgCode]


LEFT JOIN OCLG T1 ON T0.CardCode = T1.CardCode

WHERE T1.[CntctType] = '4'

I expect to see all BP's from OCRD and then any activity numbers or blank/null based on the criteria. Changing the join in the query doesn't change the results which I find strange. Maybe I'm looking at this completely wrong. Thanks in advance.