Adding Table to Canned Report

Hi I am working on adding a field from another table into a canned report, and I’m struggling with getting the report to successfully generate. I created the relationship already in RDD and made the sure the columns needed weren’t excluded, but when just trying to edit the expression for the data set I get an error “Incorrect syntax near the keyword ‘JOIN’.” The very last section for the POHeader is the only thing new I’ve added to the report.

This is the expression I have setup for the report -

“SELECT T1.AcctNum,T1.ArrivedDate,T1.AssemblySeq,T1.Company,T1.DS,T1.DtlReceiptDate,T1.HeadReceiptDate,T1.IUM,T1.JobNum,T1.JobSeq,T1.JobSeqType,T1.Name,T1.OurQty,T1.OurUnitCost,T1.PackSlip,T1.PartNum,T1.POLine,T1.PONum,T1.VendorId,T1.VendorNum,T1.Calc_Company,T1.Calc_ExtCost,T1.Calc_RcpDate,T1.Calc_RcvCost, T1.OurUnInvcReceiptQty, T1.Invoiced, T1.PartInv, T1.UnInvcExtCost
,T1.Inv_OurQty, T1.Inv_LegalNumber, T1.Inv_InvoiceNum, T1.Inv_Flag, T1.Calc_IsFirstInvoice, T2.PartNum, T2.LineDesc, T2.ClassID, T3.Description, T4.CheckBox01
FROM tRcvNoInv_” + Parameters!TableGuid.Value + " T1
LEFT OUTER JOIN PODetail_" + Parameters!TableGuid.Value + " T2 ON T1.Company = T2.Company AND T1.PONum = T2.PONum AND T1.POLine = T2.POLine

LEFT OUTER JOIN PartClass_" + Parameters!TableGuid.Value + " T3 ON T2.Company = T3.Company AND T2.ClassID = T3.ClassID

LEFT OUTER JOIN POHeader_" + Parameters!TableGuid.Value + " T4 ON T2.Company = T4.Company AND T2.PONUM = T4.PONum "

1 Like

My guess is make sure there is a space after the " T1 and before the LEFT OUTER JOIN PODetail.

If there is a missing space there the Select will fail.
DaveO

2 Likes

Also make sure there is a space after the T4.CheckBox01

1 Like

It wasn’t that spot exactly, but the spacing was the issue! It was the final statement of “LEFT OUTER…” didn’t have a space between it and the line above ending in “…T3.ClassID” it was just a paragraph break. Thanks!