=“SELECT T1.Company,T1.LegalNumber,T1.PackNum,CAST( T1.CustNum as nvarchar ) as CustNum,T1.ShipComment,T1.ShipDate,T1.Calc_BilContct,T1.Calc_BillToAddress,T1.Calc_SoldToAddress,T1.Calc_Contct,T1.Calc_CustPartOpts,T1.Calc_FOBDescription,T1.Calc_LegalNum,T1.Calc_NumRecordPerPage,T1.Calc_NumTotalParts,T1.Calc_SalesRepName,T1.Calc_ShipToAddress,T1.Calc_ShipViaDescription,T1.Calc_stPhone,T1.Calc_CusPhone,T1.Calc_stFax,T1.Calc_EMailAddress,T1.Calc_FaxNum,T1.Calc_SEmailAddr,T1.Calc_CarrierDesc,T1.Calc_ShipViaSCAC,T1.Calc_CarrierSCAC,T1.Calc_CompanyEORINumber,T1.Calc_CustShipToEORINumber, T1.Pallet1Dims_c, T1.Pallet2Dims_c, T1.Pallet3Dims_c, T1.Pallet4Dims_c, T1.Pallet5Dims_c, T1.Pallet6Dims_c, T1.Pallet7Dims_c, T1.Pallet8Dims_c,T2.PackLine,T2.Discount,T2.ExtPrice,T2.HeaderShipComment,T2.LineDesc,T2.OrderLine,T2.OrderNum,T2.OrderRelNum,T2.PartNum,T2.RevisionNum,T2.ShipComment as ShipDtl_ShipComment,T2.UnitPrice,T2.XPartNum,T2.XRevisionNum,T2.Calc_DspBackOrdQty,T2.Calc_DspBackOrdQtyUom,T2.Calc_DspLabDur,T2.Calc_DspLabMod,T2.Calc_DspLineDesc,T2.Calc_DspLineShpQty,T2.Calc_DspLineShpQtyUom,T2.Calc_DspMatDur,T2.Calc_DspMatMod,T2.Calc_DspMiscDur,T2.Calc_DspMiscMod,T2.Calc_DspPlannedQty,T2.Calc_DspPlannedQtyUom,T2.Calc_DspSerialNumber,T2.Calc_DspShipRouting,T2.Calc_DspSubShipTo,T2.Calc_GetNextLegalNum,T2.Calc_LegalText,T2.Calc_LinChangd,T2.Calc_NextLegalNumID,T2.Calc_NumLineByInv,T2.Calc_OrdRelRef,T2.Calc_POLine,T2.Calc_SalesRepName as ShipDtl_Calc_SalesRepName,T2.Calc_SerialNumLabl,T2.Calc_TotalLineCost,T2.Calc_TotalTax,T2.Calc_HidePackLine,T2.OrderLine_KitFlag,T2.OrderLine_KitParentLine,T2.OrderLine_KitPrintCompsPS,T2.OrderLine_DisplaySeq,T2.OrderLine_KitShipComplete,T2.Calc_MarkForAddress,T2.OrderNum_PONum,T2.PartNum_PartDescription,T2.PCID,T2.Calc_CommodityCode,T2.Calc_AttributeSetShortDesc,

T3.RptLiteralsLblDescription,T3.RptLiteralsLblFax, T3.RptLiteralsLblEmail,T3.RptLiteralsLblRel,T3.RptLiteralsLblPh,T3.RptLiteralsLblPO,T3.RptLiteralsLblRev,T3.RptLiteralsHComponents,T3.RptLiteralsLblBckOrQty,T3.RptLiteralsLblCustPart,T3.RptLiteralsLblDiscAmt,T3.RptLiteralsLblExtendedPrice,T3.RptLiteralsLblFOB,T3.RptLiteralsLblHdngPckSlip,T3.RptLiteralsLblLbDu,T3.RptLiteralsLblLine,T3.RptLiteralsLblMiDu,T3.RptLiteralsLblMtDu,T3.RptLiteralsLblOurPrt,T3.RptLiteralsLblPackSlip,T3.RptLiteralsLblPage,T3.RptLiteralsLblPlndQty,T3.RptLiteralsLblPoLine,T3.RptLiteralsLblPrtNum,T3.RptLiteralsLblReference,T3.RptLiteralsLblSalesOrder,T3.RptLiteralsLblSalesperson,T3.RptLiteralsLblShipDt,T3.RptLiteralsLblShipRouting,T3.RptLiteralsLblShipTo,T3.RptLiteralsLblShipVia,T3.RptLiteralsLblShpdQty,T3.RptLiteralsLblSoldTo,T3.RptLiteralsLblSrlNum,T3.RptLiteralsLblSrlNums,T3.RptLiteralsLblSubShipTo,T3.RptLiteralsLblTotalLineCost,T3.RptLiteralsLblTotalTax,T3.RptLiteralsLblUnitPrice,T3.RptLiteralsLblYourPO,T3.RptLiteralsLLegalText,T3.RptLiteralsLLegNum,T3.RptLiteralsLSalesKit,T3.RptLiteralsLCarrierSCAC,T3.RptLiteralsLCarrier,T3.RptLiteralsLblShipViaSCAC,T3.RptLiteralslblInvNumber,T3.RptLiteralslblInvDueDate,T3.RptLiteralsLblOf, T3.RptLiteralsLblContinueOnNext, T3.RptLiteralsLblComeFrom, T3.RptLiteralsLblPCID, T3.RptLiteralsLCommodityCode, T3.RptLiteralsLEORINumber, T3.RptLiteralsLblAttributeSet, T6.ResaleID, T1.Weight, T1.PkgLength, T1.PkgWidth, T1.PkgHeight, T1.PkgSizeUOM, T1.WeightUOM, T7.Name, T7.Address1, T7.Address2, T7.Address3, T7.City, T7.State, T7.Zip, T7.ManagerName, T7.PhoneNum, T9.Description as CommodityCodeDescription, T10.UnitPrice as OrderLinePrice, T10.Rpt1ListPrice

FROM ShipHead_” + Parameters!TableGuid.Value + " T1

LEFT OUTER JOIN ShipDtl_" + Parameters!TableGuid.Value + " T2

ON T1.Company = T2.Company AND T1.PackNum = T2.PackNum

LEFT OUTER JOIN RptLabels_" + Parameters!TableGuid.Value + " T3

ON T1.RptLanguageID = T3.RptLanguageID

LEFT OUTER JOIN CustomerShipTo_" + Parameters!TableGuid.Value + " T6

ON T1.Company = T6.Company AND T1.CustNum = T6.CustNum

LEFT OUTER JOIN Plant_" + Parameters!TableGuid.Value + " T7

ON T1.Company = T7.Company AND T1.Plant = T7.Plant

LEFT OUTER JOIN Part_" + Parameters!TableGuid.Value + " T8

ON T2.Company = T8.Company AND T2.PartNum = T8.PartNum

LEFT OUTER JOIN ICommCode_" + Parameters!TableGuid.Value + " T9

ON T8.Company = T9.Company AND T8.CommodityCode = T9.CommodityCode

LEFT OUTER JOIN OrderDtl_" + Parameters!TableGuid.Value + " T10

ON T2.Company = T10.Company AND T2.OrderNum = T10.OrderNum AND T2.OrderLine = T10.OrderLine"

If you can point me in any direction it would be greatly appreciated. I am currently hitting a brick wall