Hey guys. I am trying to do something I have never done here and I am not sure it is even possible. I would like to use a single SQL statement if at all possbile, but this means joining a table on a table that is being joined.
For instance... I have tblA and I am joining tblB to tblA, but then I need to join tblC and tblD to tblB...is that possible?
Here is my SQL statement and I am getting a generic error that says, "I have an error in my SQL statement", but I am not sure what it is. The only thing I can think of is it must be the way I am joining the tables.
$sql="SELECT t.*,r.*,j.*,DATE_FORMAT(j.PickupDate,'%m/%d/%Y') as NewPickupDate, u.WriterName
FROM tblTasks AS t
LEFT JOIN tblJobs as j ON j.JobID = t.JobID
LEFT JOIN tblUsers as u ON u.UserID = j.Estimator
LEFT JOIN tblRates as r ON r.RateID = j.InsuranceAgency
WHERE t.Body = 'Yes'
ORDER BY t.DateAdded DESC";
Thanks for the help!🙂