sql server - SSRS Report Parameter handling in SQL Query -
I have an SSR report where I pass the start date and end date to filter my data, let me record that Those records containing data for date values need to be received. I have query as the following.
The sample from SELECT * is s.RecStartDate & gt; = ISNULL (StartDate, s.RecStartDate) and S. Reconditioned & lt; = ISNULL (@AndDate, S.Recidadet) I have to handle 'tap' here and the data is from two different areas. But the problem is that in my SSRS report, the default value for those two dates is 'today' when I select Startdate as 10/12/2010 as 'Today' and 'Enter', according to the above situation Will never work at all. Please help me solve it.
Thanks, su
Create the following process and use this stored procedure in the dataset of your report
Setting process to start dbo.SomeReportProc @StartDate DATETIME, @EndDate as DATETIME; DECLARE @Sql NVARCHAR (max); SET @Sql = N'SELECT * From the sample where 1 = 1 '+ case when the @tartdate is not faucet and S. RCAtartDate & gt; = @StartDate 'ELSE N' 'end + case when the end date is not faucet then N and S. Recendet & lt; = @EndDate 'ELSE N' 'END EXECUTE sp_executesql @Sql, N' Start Date Detet, @edetate dateet, @tartdate, @and date and note Also make sure that you select the parameter type to be datetime , when users enter that date, then select that good GUI Using datum in different formats. Data Time Parameter On Report
Data Time Parameter Properties
Comments
Post a Comment