I tried a variety of variations of the query syntax but all error out. I even took the whole query into SSMS and adjusted the statement to use the GUID and it works fine, so thinking I’m missing something else.
If I run the main report it’s just the generic “Error: Subreport could not be shown.”
Ending syntax:
WHERE T1.InvoiceNum = "+Parameters!InvcDtl_InvoiceNum.Value+" "
Would that be applicable to a subreport, though?
All of those parameters he’s passing are pushed in from the main report, so they should be available to filter on within the query.
@Randy what happens if you remove the parameter and hard code an invoice number? Does it work then? That would confirm if the issue is with your parameter vs syntax.
If I hard code the invoice number the preview on the subreport worked but main report would still say “Error: Subreport could not be shown.” It was driving me so I slept on it.
Today I kept working at it and trying various Google searches, finally found this article. Since both InvoiceNum and Company are columns in the dataset I changed the query where to:
WHERE T1.InvoiceNum = @InvoiceNum AND T1.Company = @Company "
Got another error that the parameters were not defined, "Must declare the scalar variable "@… " so I added them to the dataset’s parameters tab and Eureka!