ssrs date question (1 Viewer)

ielamrani

Registered User.
Local time
Yesterday, 22:29
Joined
May 6, 2008
Messages
51
Hi,

I have an ssrs report with 2 parameters.

start date with expression: =DateAdd("d",-1,Today())
and end date with expression: = today()

it works but query return date after midnight. I want End date to return yesterday's date up to 11:59PM only

Thank you.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 03:29
Joined
Feb 19, 2013
Messages
14,689
if this is ssrs then you the dateadd function is slightly different to vba. Try

DateAdd(DateInterval.Day, -1, Today)
 

ielamrani

Registered User.
Local time
Yesterday, 22:29
Joined
May 6, 2008
Messages
51
Thanks for your quick reply.

I tried it and got no data returned
 

ielamrani

Registered User.
Local time
Yesterday, 22:29
Joined
May 6, 2008
Messages
51
Problem solved. I used the following in the query where clause:

(DATEDIFF(d, @startdate, a.delivery_datetime) >= 0) AND (DATEDIFF(d, @enddate, a.delivery_datetime) <= 0)
 

ielamrani

Registered User.
Local time
Yesterday, 22:29
Joined
May 6, 2008
Messages
51
CJ,

yours worked also. I did not apply it to both parameters.

thank you.
 
Last edited:

Users who are viewing this thread

Top Bottom