﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Reporting Services / Reporting Services  / using subscriptions for Date Parameter Reports / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 13:22:06 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: using subscriptions for Date Parameter Reports</title><link>http://www.sqlservercentral.com/Forums/Topic1379766-150-1.aspx</link><description>If you have the enterprise edition a data driven subscription is absolutely the way to go.  Assuming your report would run on the first of every month you could use:SELECT DATEADD('mm',-1,GetDate()) AS StartDate, DATEADD('dd'-1,GetDate()) AS EndDate.If you don't have the enterprise edition, then you are probably stuck with the default values for your parameters approach</description><pubDate>Fri, 02 Nov 2012 07:28:59 GMT</pubDate><dc:creator>Daniel Bowlin</dc:creator></item><item><title>RE: using subscriptions for Date Parameter Reports</title><link>http://www.sqlservercentral.com/Forums/Topic1379766-150-1.aspx</link><description>Enterprise Editon?Data Driven Subscriptions come to mind, especially with Quarterly and Yearly you mentioned.Each subscription could pass the different dates easily.</description><pubDate>Fri, 02 Nov 2012 06:48:52 GMT</pubDate><dc:creator>Greg Edwards-268690</dc:creator></item><item><title>RE: using subscriptions for Date Parameter Reports</title><link>http://www.sqlservercentral.com/Forums/Topic1379766-150-1.aspx</link><description>For start date to always get Previous Month Use=Datetime.Today.AddDays(-Day(Datetime.Today)+1).AddMonths(-1)For End Date to get Last Date of Previous Month=Datetime.Today.AddDays(-Day(Datetime.Today))</description><pubDate>Thu, 01 Nov 2012 13:02:49 GMT</pubDate><dc:creator>Ray M</dc:creator></item><item><title>RE: using subscriptions for Date Parameter Reports</title><link>http://www.sqlservercentral.com/Forums/Topic1379766-150-1.aspx</link><description>hmmm... I must not be doing something right. I get this error when I set the default parametersvalue provided for the report parameter 'DateStart' is not valid for its type. (rsReportParameterTypeMismatch) Get Online Help   </description><pubDate>Thu, 01 Nov 2012 12:04:26 GMT</pubDate><dc:creator>jagnew</dc:creator></item><item><title>RE: using subscriptions for Date Parameter Reports</title><link>http://www.sqlservercentral.com/Forums/Topic1379766-150-1.aspx</link><description>Add 1 month to the start date, and subtract 1 day. :-)</description><pubDate>Thu, 01 Nov 2012 11:53:14 GMT</pubDate><dc:creator>Jason Selburg</dc:creator></item><item><title>RE: using subscriptions for Date Parameter Reports</title><link>http://www.sqlservercentral.com/Forums/Topic1379766-150-1.aspx</link><description>these parameter defaults sounds like the way I want to go.what you've shown me gets me the first of the previous month (assuming the report is generated on the first day of the month). But how do I get the last day of the previous month?</description><pubDate>Thu, 01 Nov 2012 11:50:07 GMT</pubDate><dc:creator>jagnew</dc:creator></item><item><title>RE: using subscriptions for Date Parameter Reports</title><link>http://www.sqlservercentral.com/Forums/Topic1379766-150-1.aspx</link><description>There are a few ways to handle this.You can leave the report with StartDate and EndDate Parameters.Edit the report and give the Parameters Default Values.StartDate will be =Datetime.Today.AddDays(-Day(Datetime.Today.AddDays(-1)))Will be the first of the Current Month, But if it is the first, it will be first of Prev Month.and EndDate will be Datetime.Today. And Make sure the report is using these days correctly.and when you schedule the subscription, just have it use the Default value.Or you can add a drop down with values like "This Month","Last Month", "This Year". And your code can interpret these values to generate the dates.</description><pubDate>Thu, 01 Nov 2012 10:07:24 GMT</pubDate><dc:creator>Ray M</dc:creator></item><item><title>using subscriptions for Date Parameter Reports</title><link>http://www.sqlservercentral.com/Forums/Topic1379766-150-1.aspx</link><description>I have a report created that has two datetime parameters.I want to set up a monthly subscription for the report filling in the first and last days of the previous month as the two datetime parameters.So each month when the subscription runs, it should generate reporting information based on the previous month.I don't want to hardcode this because I want to use the same report to do quarterly and yearly subscriptions.Does anyone know a method to do this?</description><pubDate>Thu, 01 Nov 2012 06:07:30 GMT</pubDate><dc:creator>jagnew</dc:creator></item></channel></rss>