I have a stored procedure which takes start date and end date, it performs a query and returns results in a pivot table.
The stored procedure works well I think.
If I run the stored procedure in a report I get a different result set using the same input values.
I have run it through the profiler and can see that report builder calls the stored procedure liks this.
exec usp_PC_corp_KPIHrs @startdate='2016-08-28 00:00:00',@enddate='2016-09-07 00:00:00
Running the stored procedure from management studio looks like this.
exec usp_PC_corp_EmployeeKPIHrs123 '20160828','20160907'
I have no idea how I can get two different results when I appear to be running the same sql statement.
If I pick up the profiler response from the report builder and run it via management studio I get a different result.
Running the query in the query designer also returns the same results as if I had run the query in management studio. Yes different to running the query in the report.
The tablix properties in the report is not filtering any of the results.