I have a query I am having problems with and I could use some help. I am very new to VB and SQL so please bare with me. I need to query a table (LineEquipment) in this case and return all records on a given range. I also need to retrieve data from other tables which I may or may not have a matching join. For the report I am attempting to produce I need to list the All Line Equipment table records regardless if the have a join match or not. This query works for that at this point:
SELECT PUB.LineEquipment.LineEq, PUB.LineEquipment.TTorRotary, PUB.LineEquipment.PriorInterface, PUB.LineEquipment.WiredInCO,
PUB.PlantStatus.StatusCode, PUB.LineEquipment.RCEWRID, PUB.SubEquipment.PhoneEqID
FROM PUB.PlantStatus, { oj PUB.SubEquipment RIGHT OUTER JOIN
PUB.LineEquipment ON PUB.SubEquipment.LineEqID = PUB.LineEquipment.LineEqID }
WHERE PUB.PlantStatus.StatusID = PUB.LineEquipment.StatusID AND (PUB.LineEquipment.RCEWRID = 1001001001004)
ORDER BY PUB.LineEquipment.LineEq
Now where things go wrong is when I add a join to a table called Phone, so I can list the phone number, joining by a field named PhoneEqID which is contained in the Sub Equipment table. Once I add the Phone table join, any Line Equipment records that don't match the join in the SubEquipment to Phone table no longer show in the query results but I want them to either way. I have been told that maybe a sub query may work but I have no idea if it would and what the syntax would be. Anyway I try in the query builder in VS2008 I can't get what I want.
Thanks
Al