July 28, 2011 at 2:26 am
I've got a report I'd like to create a subscription for, the report has max and min date parameters. I'd like the subscription to be based on different dates according to he date it's sent.
When I've looked at this in the past I've came to the conclusion that you can just specify two date points and that if you create a subscription its just going to evaluate against these two date points each time.
So, based on this in the past I've created duplicate reports (by copy/paste code/sp) and removed parameters and dealt with the date side of things myself by using something like date between dateadd(ww, -2, getdate()) and getdate() to return the last 2 weeks worth of data from the date I'm sending the report.
It's a chore having to create an entirely new report just for this feature, especially when different people request different schedules and time intervals.
Am I missing a trick here or is this the only way to achieve this?
July 28, 2011 at 7:54 am
Create a data driven subscription. I do this with dates all the time.
SELECT StartDateParm = DATEADD(dd,-7,GetDate()), EndDateParm = GetDate()
As you set up your subscription, you use StartDateParm and EndDateParm to feed values to your report's input parameters. Step through the wizard, and you should see what I mean.
July 28, 2011 at 10:15 am
Gah, I got well into looking at this and then discovered that it's only in the Enterprise edition of SQL 🙁
Thanks for the pointer - it's exactly what I'm looking for :/ !
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply