all groups > sql server reporting services > april 2005 >
You're in the

sql server reporting services

group:

Expressions for parameter values??


Re: Expressions for parameter values?? Rajeev Karunakaran
4/26/2005 6:16:54 PM
sql server reporting services:
You can use the DateAdd function to add a day/hour/minute/month etc to a
date.

--
Rajeev Karunakaran [MSFT]
Microsoft SQL Server Reporting Services

This posting is provided "AS IS" with no warranties, and confers no rights.

[quoted text, click to view]

Expressions for parameter values?? Arthur Dent
4/26/2005 7:53:37 PM
Hello all.... im trying to figure out... how can i use an expression in a
parameter formula?

I have a report which takes a date parameter. I want to make a subscription
using last week as the date. So for example, i want to set up the
subscription to run every Sunday, and use a value of TODAY() - 7. If i enter
that as a value though, it says its an invalid type. I also tried it with an
equal sign on the front ( =TODAY()-6 ).

Is there a way to do this?

Thanks in advance,
- Arthur Dent.

Re: Expressions for parameter values?? Robert Bruckner [MSFT]
4/26/2005 8:39:43 PM
It sounds like you are trying to type an expression into the date field in
report manager. This won't work - you can only type date constants there.

You should rather load the report in report designer and set the default
value of the date parameter to something like =Today.AddDays(-7). Before
publishing to the report server, make sure to delete the existing report
*before* publishing.
Then, you can create a subscription which will use an expression-based
default value for the date parameter.


-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.


[quoted text, click to view]

Re: Expressions for parameter values?? Arthur Dent
4/26/2005 10:28:38 PM
Thanks for the reply. Unfortunately, that doesnt seem to work either. When i
type in "DATEADD(d,-7,TODAY())" for my parameter, i get an error as so:

The value provided for the report parameter 'ForWeekOf' is not valid for its
type. (rsReportParameterTypeMismatch)
TIA-


"Rajeev Karunakaran" <rajeevkarunakaran@online.microsoft.com> wrote in
message news:edMnSbsSFHA.3672@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

Re: Expressions for parameter values?? Arthur Dent
4/26/2005 11:49:12 PM
Ah, yes, that sounds like it would do exactly what i need.
Thanks!!


[quoted text, click to view]

AddThis Social Bookmark Button