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.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.
"Arthur Dent" <hitchhikersguideto-news@.yahoo.com> wrote in message
news:u7NwrsrSFHA.3140@.TK2MSFTNGP14.phx.gbl...
> 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.
>|||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...
> 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.
> "Arthur Dent" <hitchhikersguideto-news@.yahoo.com> wrote in message
> news:u7NwrsrSFHA.3140@.TK2MSFTNGP14.phx.gbl...
>> 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.
>|||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.
"Arthur Dent" <hitchhikersguideto-news@.yahoo.com> wrote in message
news:eYecTDtSFHA.3184@.TK2MSFTNGP14.phx.gbl...
> 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...
>> 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.
>> "Arthur Dent" <hitchhikersguideto-news@.yahoo.com> wrote in message
>> news:u7NwrsrSFHA.3140@.TK2MSFTNGP14.phx.gbl...
>> 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.
>>
>|||Ah, yes, that sounds like it would do exactly what i need.
Thanks!!
"Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
news:O69jArtSFHA.2556@.TK2MSFTNGP12.phx.gbl...
> 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.
>
> "Arthur Dent" <hitchhikersguideto-news@.yahoo.com> wrote in message
> news:eYecTDtSFHA.3184@.TK2MSFTNGP14.phx.gbl...
>> 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...
>> 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.
>> "Arthur Dent" <hitchhikersguideto-news@.yahoo.com> wrote in message
>> news:u7NwrsrSFHA.3140@.TK2MSFTNGP14.phx.gbl...
>> 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.
>>
>>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment