I am in the process of transitioning a system from MySQL to SQL Server. Both systems are using MyDBR.
I want to create a popup linked drilldown report from my summary report that passes in three parameters. The code from the summary report is:
SELECT 'dbr.hidecolumns',2;SELECT 'dbr.report', 'sp_DBR_CollectionsDeltaDrillDown', '[rep]','popup','@Repname = [Rep]','@StartDate = [StartDate]','@EndDate = [EndDate]';
SELECT r1.RepName AS 'RepName[Rep]',r1.OpenCollections AS Starting,r2.OpenCollections+r2.Net AS Ending,r2.OpenCollections+r2.Net-r1.OpenCollections AS Delta,@StartDate AS [StartDate],@EndDate AS [EndDate]
FROM [Report].[CollectionsDelta] r1
INNER JOIN [Report].[CollectionsDelta] r2
ON r1.RepName = r2.RepName
WHERE r1.ReportDate = @startDate
AND r2.ReportDate = @endDate;
When loading the summary report, I get:
Unknown column reference: [rep]
Unknown column reference: [StartDate]
Unknown column reference: [EndDate]
I can still click through to the drilldown, but of course my input parameters do not carry over. Code very similar to this would have worked in MySQL. How can I get the dbr.report command to pass my parameters in SQL Server?