Originally Posted by neil-j
I need to retrieve data from three tables and every syntax error I solve seems to cause several more issues! (I am a basic user of queries)
Please could anyone read what I have done below and suggest a way of getting this to work? 'Searches' contains Job_Refs, and joins to 'Product' to identify the name of the product being requested. 'Searches' needs to join to 'Plan' via CaseFile which holds the PlanID number. ('Searches' therefore must also join CaseFile on CaseFileID
Select a.ExternalWebServiceID as Job_Ref,
Product.OurCode as Report_Type,
plan.PointEastings as Site_Easting,
plan.PointNorthing as Site_Northing,
CaseFile.PlacedDate as Report_Date,
'\\blah\blah\' + b.ExternalWebServiceID + 'sxw' as FilePath
from
Searches a
join Product on Searches.ProductID = Product.ProductID,
Searches b
join CaseFile on Searches.CaseFileId = CaseFile.CaseFileID,
Casefile join Plan on CaseFile.PlanId = Plan.PlandID