Sunday, February 19, 2012

datediff with parameter

Hi
I am trying to run the following query but want to use a parameter instaed
of the -7
BETWEEN GETDATE() AND DATEADD(d, -7, GETDATE())
ive tried BETWEEN GETDATE() AND DATEADD(d, @.date, GETDATE()) with the
parameter set is an int & text but to no avaial.
Thanks in advanceTry BETWEEN GETDATE() AND DATEADD("d",CONVERT(INT,@.date),GETDATE())
I got it to work by converting the param to INT. It appears SSRS
defaults params to the nvarchar datatype.
Hang in there
toolman
Tango wrote:
> Hi
> I am trying to run the following query but want to use a parameter instaed
> of the -7
> BETWEEN GETDATE() AND DATEADD(d, -7, GETDATE())
> ive tried BETWEEN GETDATE() AND DATEADD(d, @.date, GETDATE()) with the
> parameter set is an int & text but to no avaial.
> Thanks in advance

No comments:

Post a Comment