Report Builder

I’m reviewing and learning how my predecessor made some of his reports. One this I have noticed in the Query part of Report Builder is the use of T1.wahtever in his queries. I do not recognize the T1, and am needing some help in understanding what that is relating to.

Usually, in the query at the top of the Report (usually in XML format) Dataset, there is a SELECT statement. In the SELECT statement, it gives the table in question the alias “T1”

Take this, for example: Select * FROM Erp.Part as T1

For the rest of the code, you can write T1.PartNum instead of calling out the full name Erp.Part.PartNum each time. Is that what you’re asking perhaps?

Gotcha, makes sense. So, I needed to add Address1,2,3, city,s tate, and Zip from CheckHed to this. AM I corect in that T2 is Checkhed?

“SELECT T1.BankAcctID,T1.Company,T1.[Description],T1.Calc_BaseCurrencySymbol,T1.Calc_CurrencyCount, T2.BankAcctID as CheckHed_BankAcctID,T2.CheckAmt,T2.CheckDate,T2.CheckNum,T2.Company as CheckHed_Company,T2.CurrencyCode,T2.DocCheckAmt,T2.HeadNum,T2.ManualPrint,T2.Name,T2.VendorNum,T2.Voided,T2.Address1,T2.Address2,T2.Address3,T2.City.T2.State.T2.Zip,T2.Calc_DocCheckAmt,T2.Calc_VendorID,T2.Calc_VoidManualCheck,T2.Calc_VendorCurrency,T2.CurrencyCode_CurrDesc,T2.CurrencyCode_CurrencyID,T2.CurrencyCode_CurrName,T2.CurrencyCode_CurrSymbol,CAST( T2.CurrencyCode_DecimalsGeneral as nvarchar ) as CurrencyCode_DecimalsGeneral,T2.CurrencyCode_DocumentDesc,T2.Calc_DspBankCheckAmt
FROM BankAcct_” + Parameters!TableGuid.Value + " T1
LEFT OUTER JOIN CheckHed_" + Parameters!TableGuid.Value + " T2
ON T1.Company = T2.Company AND T1.BankAcctID = T2.BankAcctID"

You got it! T2.

1 Like

Awesome! One lat question, I ran this in SSRS and got his error. Query execution failed for dataset ‘RptParameter’. (rsErrorExecutingCommand)

I have added everything in the query and the fields, is there another place i should look?

Are you editing the XML directly, or using the Report Builder or some other GUI?

Report Builder

I’m not too familiar with the Report Builder, but I distinctly recall if I add fields to the SELECT part of the query, I have to also go down to the lower section of the XML file and make an entry there, like this modified ARForm report where I added T6.CustID as T6_CustID, and then I had to create an XML Reference to it in the “Field Name” section:

I’m sure, however, that Report Builder probably does all of that for you automatically, so I would first check the Report Data Definition and make sure the fields you are trying to add are included and not hidden inside the RDD itself.