Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter found record between 2 Tables
Message
 
To
26/07/2000 23:34:14
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00396488
Message ID:
00397499
Views:
8
>>>I have 2 Tables
>>>(1)Customer - CustCode,.......
>>>(2)CustTrans - CustCode, CaseClosed (boolean),.......
>>> (will have multiple records of same CustCode)
>>>
>>>I would like to get all rows from the Customer table, but
>>>exclude those rows that the CustCode is found in the CustTrans
>>>table AND with the CaseClosed status is "False".
>>>
>>>How should my SQL statement be like, pls advise, thanks.
>>
>>Select *
>>FROM Customer LEFT OUTER JOIN CustTrans
>>ON Customer.CustCode = CustTrans.CustCode
>>WHERE CustTrans.CaseClosed = True
>
>I tried the statement but I have one issue.
>It will return all rows if the CustTrans.CaseClosed = True.
>
>I only want to get rows that CustTrans.CaseClose is not "True"
>or another words not found in the CustTrans table that having the
>CaseClose status as "True".
>
>But I can't use "False" for checking, because there will be some
>records that have the status "False", represention the case have
>been closed.
>
>Do I need to have multiple SELECT statement? Pls advise, thanks alot.

I'm lost!!! Not True means False but you can't check for False?!?!?!

Replicate a simplified structure of your 2 tables here with some data so I can build it on my side to find the correct SQL statement.

Don't forget to display the wanted results.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform