0
votes

At SSRS, one of my reports have date range as parameter - From Date (@FD) and To Date (@TD), these two parameters pass at query for the report to generate

At SSRS the parameter is of date/time type, I'm looking for a solution whereby when user select a date range it should include the time factor as below

if the user has selected say, FD 01/09/2018 and TD 30/09/2018 from report date picker

then I want the parameter to pass as 2018-09-01 00:00:00.000 and 2018-09-30 23:59:59.000 to the query. This 00:00:00.000 and 23:59:59.000 as a fixed range suffix to date.

How to achieve it?

1

1 Answers

0
votes

I was trying combinations, this one i found working sort of.. got some clues for many forum

declare @FFD datetime2

declare @TTD datetime2

set @FFD = cast ('2018-09-01' as DATE)

set @TTD = DATEADD(s, -1, DATEADD(S, 86400, '2018-09-30'))

print @FFD

print @TTD