Wednesday, March 7, 2012

Expression as a default value problem..

I want to automatically run a report every day of the week. This isn't a problem. However I want the users to be able to run the
report whenever they feel like too. Can I put expressions in the default value entry? They don't seem to generate anything...
Here is the value I want to put in..
=CDate(IIF(datepart("w", Today) = 2, dateadd("d", -2, Today), dateadd("d", -1, Today)).ToString)
Can anyone see anything wrong with this?
Thanks
ScottWhere are you settting this expression? This should work if you pull up
Report Parameters dialog in report designer, enter this expression in
Default -> Non-queried textbox, and preview it (I just tried it to confirm.)
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Scott Meddows" <scott_meddows_no_spm@.tsged-removeme.com> wrote in message
news:u1j3alvWEHA.1888@.TK2MSFTNGP11.phx.gbl...
> I want to automatically run a report every day of the week. This isn't a
problem. However I want the users to be able to run the
> report whenever they feel like too. Can I put expressions in the default
value entry? They don't seem to generate anything...
> Here is the value I want to put in..
> =CDate(IIF(datepart("w", Today) = 2, dateadd("d", -2, Today),
dateadd("d", -1, Today)).ToString)
> Can anyone see anything wrong with this?
> Thanks
> Scott
>

No comments:

Post a Comment