0
votes

I have a report in SSRS. In my main report I am linking to another report using a link action.

I need to pass in two variables to linked report. One for startdate and one for enddate. I need to pass in start date as first day of current month 12.00am and enddate as yesterday 1259pm

Trying to do this with an expression. Any help appreciated.
I can do this with sql as below, but need to convert this to expression used in SSRS.

Set @startdate = DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0)
Set @enddate = DATEADD(ms,-3, DATEADD(day, DATEDIFF(day,0,GETDATE()),0))
1

1 Answers

0
votes

try using expression

First Day of current month

   =DateSerial(Year(Now()), Month(Now()), "1")

Previous Day (Yesterday)

   =DateSerial(Year(Now()), Month(Now()), Day(Now())).AddDays(-1) & " 23:59:59"