I'm using SQL joins from three child tables, to form one table, and that works fine.
However, I would like to pull the name of a customer from a table that is a parent, in the same SQL statement.
Here is the code to my working Three Table Join:
LEFT JOIN approvals ON (traveldocuments.Id=approvals.TDId)
LEFT JOIN commodities ON (traveldocuments.Id=commodities.TDId);
I tried adding the field: customers.CustomerName, and another Join: LEFT JOIN customers ON (traveldocuments.ID=customers.ID);
But all I get are NULL values in the Joined Column, instead of the Customer Names.
So I'm not sure how to get the Name of the Customer, corresponding to the TDId. With the other tables, approvals and commodities, they are child tables, but the now the Customers is a parent Table to traveldocuments.
Any help would be appreciated.