I believe this is where this question should be. I have data in an external DB that I use Excel and Microsoft Query to pull data from. Here is my current SQL query.
Now I've tried using a LEFT OUTER JOIN, but I could not get it working. I essentially want all of my records from CRMCall. Then I link it to Customer to get Customer.Name. Then I link that to CustCnt to get CustCnt.Name. My dilema is that not every record in CRMCall has a CustCnt.Name record associated with it. I want to show all records in CRMCall, regardless if whether or not they have a CustCnt. If my CRMCall record has a CustCnt.Name, I want to display the name, if it does not, I want it to be blank, or NULL, or whatever other value.
Thanks in advance!
Code:
SELECT DISTINCT Customer_0.Name, CRMCall_0.SalesRepCode, CRMCall_0.OrigDate, CRMCall_0.CallText, CustCnt_0.Name, CRMCall_0.CallDesc
FROM PUB.CRMCall CRMCall_0, PUB.CustCnt CustCnt_0, PUB.Customer Customer_0
WHERE Customer_0.Company = CRMCall_0.Company AND Customer_0.CustNum = CRMCall_0.CallCustNum AND CustCnt_0.Company = CRMCall_0.Company AND CustCnt_0.Company = Customer_0.Company AND CustCnt_0.CustNum = Customer_0.CustNum AND CustCnt_0.ShipToNum = Customer_0.ShipToNum AND CustCnt_0.ConNum = CRMCall_0.CallConNum
ORDER BY CRMCall_0.OrigDate
Now I've tried using a LEFT OUTER JOIN, but I could not get it working. I essentially want all of my records from CRMCall. Then I link it to Customer to get Customer.Name. Then I link that to CustCnt to get CustCnt.Name. My dilema is that not every record in CRMCall has a CustCnt.Name record associated with it. I want to show all records in CRMCall, regardless if whether or not they have a CustCnt. If my CRMCall record has a CustCnt.Name, I want to display the name, if it does not, I want it to be blank, or NULL, or whatever other value.
Thanks in advance!