<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Find Last Day of Any Month &#8211; Current Previous Next</title>
	<atom:link href="http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/</link>
	<description>Notes of a SQL Server MVP and Database Administrator</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:54:09 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: J. Unger</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-57418</link>
		<dc:creator>J. Unger</dc:creator>
		<pubDate>Sun, 08 Nov 2009 00:43:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-57418</guid>
		<description>Pinal, your script worked perfectly. Thank you very much for sharing this!</description>
		<content:encoded><![CDATA[<p>Pinal, your script worked perfectly. Thank you very much for sharing this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-56871</link>
		<dc:creator>Brian Tkatch</dc:creator>
		<pubDate>Wed, 21 Oct 2009 18:11:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-56871</guid>
		<description>@zee

WHERE	date-COLUMN &gt;= CASE
	 WHEN DATEPART(dd, GETDATE()) &lt; 16 THEN DATEADD(DD, 15, DATEADD(mm, DATEDIFF(m, 0, GETDATE()) - 1, 0))
	 ELSE DATEADD(mm, DATEDIFF(m, 0, GETDATE()), 0)
	END
AND date-COLUMN &lt;
	CASE
	 WHEN DATEPART(dd, GETDATE()) &lt; 16 THEN DATEADD(mm, DATEDIFF(m, 0, GETDATE()), 0)
	 ELSE DATEADD(DD, 15, DATEADD(mm, DATEDIFF(m, 0, GETDATE()) - 1, 0))
	END</description>
		<content:encoded><![CDATA[<p>@zee</p>
<p>WHERE	date-COLUMN &gt;= CASE<br />
	 WHEN DATEPART(dd, GETDATE()) &lt; 16 THEN DATEADD(DD, 15, DATEADD(mm, DATEDIFF(m, 0, GETDATE()) &#8211; 1, 0))<br />
	 ELSE DATEADD(mm, DATEDIFF(m, 0, GETDATE()), 0)<br />
	END<br />
AND date-COLUMN &lt;<br />
	CASE<br />
	 WHEN DATEPART(dd, GETDATE()) &lt; 16 THEN DATEADD(mm, DATEDIFF(m, 0, GETDATE()), 0)<br />
	 ELSE DATEADD(DD, 15, DATEADD(mm, DATEDIFF(m, 0, GETDATE()) &#8211; 1, 0))<br />
	END</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zee</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-56859</link>
		<dc:creator>zee</dc:creator>
		<pubDate>Wed, 21 Oct 2009 13:59:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-56859</guid>
		<description>hi there 

I need to have a bimonthly report i.e. once with 01/01/2009 to 15/01/2009 
and then 16/01/2009 to 31/01/2009

i want to know how can i get starting and ending dates like 1 and 15 of current month if the current date is &gt; 15 and 16 to 30/31 of the previous month if current date is &lt; 15

thanks a lot in advance.

zee</description>
		<content:encoded><![CDATA[<p>hi there </p>
<p>I need to have a bimonthly report i.e. once with 01/01/2009 to 15/01/2009<br />
and then 16/01/2009 to 31/01/2009</p>
<p>i want to know how can i get starting and ending dates like 1 and 15 of current month if the current date is &gt; 15 and 16 to 30/31 of the previous month if current date is &lt; 15</p>
<p>thanks a lot in advance.</p>
<p>zee</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ayo A</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-56446</link>
		<dc:creator>Ayo A</dc:creator>
		<pubDate>Mon, 05 Oct 2009 17:24:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-56446</guid>
		<description>what will select dateadd(s,-1,dateadd(mm,datediff(m,0,getdate())+1,0))) return?
thanks</description>
		<content:encoded><![CDATA[<p>what will select dateadd(s,-1,dateadd(mm,datediff(m,0,getdate())+1,0))) return?<br />
thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JR</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-56246</link>
		<dc:creator>JR</dc:creator>
		<pubDate>Tue, 29 Sep 2009 13:53:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-56246</guid>
		<description>Most beneficial, 

Thanks</description>
		<content:encoded><![CDATA[<p>Most beneficial, </p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raj</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-55755</link>
		<dc:creator>Raj</dc:creator>
		<pubDate>Wed, 09 Sep 2009 16:42:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-55755</guid>
		<description>thanks a lot man 

u r awesome 
thank u</description>
		<content:encoded><![CDATA[<p>thanks a lot man </p>
<p>u r awesome<br />
thank u</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shekhar</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-55119</link>
		<dc:creator>Shekhar</dc:creator>
		<pubDate>Sat, 22 Aug 2009 10:10:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-55119</guid>
		<description>Thanks ,sunny
It&#039;s very useful for me ............thanks a lot</description>
		<content:encoded><![CDATA[<p>Thanks ,sunny<br />
It&#8217;s very useful for me &#8230;&#8230;&#8230;&#8230;thanks a lot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atin Srivastava</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-54458</link>
		<dc:creator>Atin Srivastava</dc:creator>
		<pubDate>Wed, 05 Aug 2009 07:48:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-54458</guid>
		<description>All above statements seems complicated to find last date of previous month... how abt this

select dateadd(d,-day(getdate()),getdate())</description>
		<content:encoded><![CDATA[<p>All above statements seems complicated to find last date of previous month&#8230; how abt this</p>
<p>select dateadd(d,-day(getdate()),getdate())</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SFC</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-53582</link>
		<dc:creator>SFC</dc:creator>
		<pubDate>Thu, 09 Jul 2009 17:21:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-53582</guid>
		<description>Please help.  In my stored procede, I want to assign the return value of &#039;SELECT DATEADD(dd, -Day(GetDate()), GetDate())&#039; to a variable, e.g.

SET @PreMonthEnd = SELECT DATEADD(dd, -Day(GetDate()), GetDate())

What is the correct statement I should write?  Thanks a lot.</description>
		<content:encoded><![CDATA[<p>Please help.  In my stored procede, I want to assign the return value of &#8216;SELECT DATEADD(dd, -Day(GetDate()), GetDate())&#8217; to a variable, e.g.</p>
<p>SET @PreMonthEnd = SELECT DATEADD(dd, -Day(GetDate()), GetDate())</p>
<p>What is the correct statement I should write?  Thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-52872</link>
		<dc:creator>Brian Tkatch</dc:creator>
		<pubDate>Tue, 09 Jun 2009 12:37:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-52872</guid>
		<description>@Donna

You can subtract the amount of days in the passed date. That will give the last day of the prior month.

DECLARE @A DATETIME
SET @A = &#039;04/30/2009&#039;
select DATEADD(d, -DATEPART(d, @A), @A)</description>
		<content:encoded><![CDATA[<p>@Donna</p>
<p>You can subtract the amount of days in the passed date. That will give the last day of the prior month.</p>
<p>DECLARE @A DATETIME<br />
SET @A = &#8216;04/30/2009&#8242;<br />
select DATEADD(d, -DATEPART(d, @A), @A)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Donna</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-52844</link>
		<dc:creator>Donna</dc:creator>
		<pubDate>Mon, 08 Jun 2009 21:23:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-52844</guid>
		<description>Also,  the date the user will be entering will always be the last day of some month.

Thanks,</description>
		<content:encoded><![CDATA[<p>Also,  the date the user will be entering will always be the last day of some month.</p>
<p>Thanks,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Donna</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-52842</link>
		<dc:creator>Donna</dc:creator>
		<pubDate>Mon, 08 Jun 2009 21:12:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-52842</guid>
		<description>I need to find the last day of the previous month based on a date entered by a user.</description>
		<content:encoded><![CDATA[<p>I need to find the last day of the previous month based on a date entered by a user.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NZamora</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-52712</link>
		<dc:creator>NZamora</dc:creator>
		<pubDate>Wed, 03 Jun 2009 23:26:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-52712</guid>
		<description>You&#039;re the man!
Whenever I have a question google sends me to you...
And you always have an answer.
Kudos to you!</description>
		<content:encoded><![CDATA[<p>You&#8217;re the man!<br />
Whenever I have a question google sends me to you&#8230;<br />
And you always have an answer.<br />
Kudos to you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: assa</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-51584</link>
		<dc:creator>assa</dc:creator>
		<pubDate>Wed, 06 May 2009 06:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-51584</guid>
		<description>how to find the day of month ........
only enter month
ex:month=04
then
find the last date of this month.....using vb.net</description>
		<content:encoded><![CDATA[<p>how to find the day of month &#8230;&#8230;..<br />
only enter month<br />
ex:month=04<br />
then<br />
find the last date of this month&#8230;..using vb.net</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sivaram</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-51016</link>
		<dc:creator>Sivaram</dc:creator>
		<pubDate>Wed, 15 Apr 2009 13:24:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-51016</guid>
		<description>No need to use DateDiff. Inside Dateadd we can use another DateAdd .

Eg. SELECT DATEADD(DD,-1,DATEADD(M, 2,GETDATE()))</description>
		<content:encoded><![CDATA[<p>No need to use DateDiff. Inside Dateadd we can use another DateAdd .</p>
<p>Eg. SELECT DATEADD(DD,-1,DATEADD(M, 2,GETDATE()))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Sandy</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-49146</link>
		<dc:creator>Peter Sandy</dc:creator>
		<pubDate>Sun, 15 Mar 2009 22:02:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-49146</guid>
		<description>Hi Dave,

Can someone tell me how to get previous year previous month Date from todays date? I need to know, how we will get 02/29/2008.

Thanks in advance.

-Peter</description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>Can someone tell me how to get previous year previous month Date from todays date? I need to know, how we will get 02/29/2008.</p>
<p>Thanks in advance.</p>
<p>-Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: code4food</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-48153</link>
		<dc:creator>code4food</dc:creator>
		<pubDate>Thu, 05 Mar 2009 20:17:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-48153</guid>
		<description>Very helpful. Thanks for sharing!</description>
		<content:encoded><![CDATA[<p>Very helpful. Thanks for sharing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Platz</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-47601</link>
		<dc:creator>Paul Platz</dc:creator>
		<pubDate>Fri, 27 Feb 2009 20:52:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-47601</guid>
		<description>Thanks Dave, your programming is very helpful.</description>
		<content:encoded><![CDATA[<p>Thanks Dave, your programming is very helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQLAuthority News - Best Articles on SQLAuthority.com Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-47240</link>
		<dc:creator>SQLAuthority News - Best Articles on SQLAuthority.com Journey to SQL Authority with Pinal Dave</dc:creator>
		<pubDate>Tue, 24 Feb 2009 12:10:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-47240</guid>
		<description>[...] SQL SERVER - Find Last Day of Any Month - Current Previous Next [...]</description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER &#8211; Find Last Day of Any Month &#8211; Current Previous Next [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don</title>
		<link>http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-46316</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Wed, 04 Feb 2009 09:09:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/#comment-46316</guid>
		<description>Dave, thanks its helped me alot.</description>
		<content:encoded><![CDATA[<p>Dave, thanks its helped me alot.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
