If I use this in my dataset SQL:
DECLARE @StartDate DATE = '2017-01-01'
DECLARE @EndDate DATE = '2017-03-01'
The report runs and returns the expected Data.
When I change the above code to this:
DECLARE @StartDate DATE
DECLARE @EndDate DATE
I am used to Visual Studio detecting that I have two date variables and creating two Date Parameters. But in this case the parameters are not automatically created. So, I create the Parameters myself - as Date/Time.
But ... I get no data when the report runs.
The Dates that SSRS displays from the Calendar selection are in m/d/y [3/1/2017] format.
The Database field that is being used to compare with @StartDate and @EndDate is a SQL Server DateTime field.
This is an example of how the date parameters are being used in the SQL:
WHERE
a.SomeDate >= @StartDate
AND a.SomeDate < DATEADD(dd,1,@EndDate)
Other reports that I have created: 1. Automatically create the two Date Parameters once I save the Dataset. 2. Return Data as expected using the Date Parameters.
I would appreciate any suggestions. Please let me know if there is more information I can provide that will help you to help me!