﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / SQL Server 2005 General Discussion  / Last Year to Date report parameter / 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>Sat, 18 May 2013 21:07:59 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Last Year to Date report parameter</title><link>http://www.sqlservercentral.com/Forums/Topic986221-149-1.aspx</link><description>If there is a report parameter. The fomular will be=DateAdd("yyyy",-1,DateAdd("d",-1,Today()))</description><pubDate>Thu, 16 Sep 2010 09:05:53 GMT</pubDate><dc:creator>Dung Dinh</dc:creator></item><item><title>RE: Last Year to Date report parameter</title><link>http://www.sqlservercentral.com/Forums/Topic986221-149-1.aspx</link><description>My apologies and thanks for the help. It is for SSRS. The date range should have been described as January 1st of last year (1/1/2009) through yesterdays month/day/lastyear. This would be for a report parameter EndDate.edited for mistake</description><pubDate>Thu, 16 Sep 2010 05:35:29 GMT</pubDate><dc:creator>gorstl</dc:creator></item><item><title>RE: Last Year to Date report parameter</title><link>http://www.sqlservercentral.com/Forums/Topic986221-149-1.aspx</link><description>[quote][b]WayneS (9/15/2010)[/b][hr]1. Change "Today" to "GetDate()".2. In your example, you want the date range to end on 9/14/2010. I assume this is a typo, and should be 9/14/2009?[/quote]I've got the sneaky feeling that this is going to be for an SSRS report which would explain "Today" I think...Anyway, I agree... the op needs to clarify what the date range should actually be.</description><pubDate>Wed, 15 Sep 2010 18:20:07 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Last Year to Date report parameter</title><link>http://www.sqlservercentral.com/Forums/Topic986221-149-1.aspx</link><description>[quote][b]Dung Dinh (9/15/2010)[/b][hr]You should use[code="sql"]select dateadd(yy,-1,dateadd(d,-1,getdate()))[/code][/quote]Agreed... now all you need to do is to provide the other needed date. ;-)</description><pubDate>Wed, 15 Sep 2010 18:17:54 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Last Year to Date report parameter</title><link>http://www.sqlservercentral.com/Forums/Topic986221-149-1.aspx</link><description>You should use[code="sql"]select dateadd(yy,-1,dateadd(d,-1,getdate()))[/code]</description><pubDate>Wed, 15 Sep 2010 09:31:04 GMT</pubDate><dc:creator>Dung Dinh</dc:creator></item><item><title>RE: Last Year to Date report parameter</title><link>http://www.sqlservercentral.com/Forums/Topic986221-149-1.aspx</link><description>1. Change "Today" to "GetDate()".2. In your example, you want the date range to end on 9/14/2010. I assume this is a typo, and should be 9/14/2009?</description><pubDate>Wed, 15 Sep 2010 08:48:48 GMT</pubDate><dc:creator>WayneS</dc:creator></item><item><title>Last Year to Date report parameter</title><link>http://www.sqlservercentral.com/Forums/Topic986221-149-1.aspx</link><description>Hello,I am trying to build a report that needs to query records between Jan01 of last year through yesterdays date, last year. In other words, for today (9/15/2010) I would need 1/1/2009-9/14/2010. I am using the following for my EndDate=DateAdd("y", -1, (Dateadd("d", -1, Today)))It keeps pulling records from both years.Any help for this Newbie would be appreciated.</description><pubDate>Wed, 15 Sep 2010 06:49:58 GMT</pubDate><dc:creator>gorstl</dc:creator></item></channel></rss>