<?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/"
		>
<channel>
	<title>Comments on: Oracle SQL: Use sysdate for start and end of previous month and year</title>
	<atom:link href="http://edwardawebb.com/database-tips/sysdate-determine-start-previous-month-year-oracle-sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://edwardawebb.com/database-tips/sysdate-determine-start-previous-month-year-oracle-sql</link>
	<description>get all his digital goodness 24/7</description>
	<lastBuildDate>Sat, 04 Feb 2012 17:05:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: mark</title>
		<link>http://edwardawebb.com/database-tips/sysdate-determine-start-previous-month-year-oracle-sql/comment-page-1/#comment-2958</link>
		<dc:creator>mark</dc:creator>
		<pubDate>Thu, 24 Nov 2011 15:46:36 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=454#comment-2958</guid>
		<description>Perfect solution for my requirement.</description>
		<content:encoded><![CDATA[<p>Perfect solution for my requirement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Logan Ramirez</title>
		<link>http://edwardawebb.com/database-tips/sysdate-determine-start-previous-month-year-oracle-sql/comment-page-1/#comment-2928</link>
		<dc:creator>Logan Ramirez</dc:creator>
		<pubDate>Thu, 11 Aug 2011 15:25:13 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=454#comment-2928</guid>
		<description>Love this!  One modification I have is to &#039;include&#039; the last day of the month by using the TRUNC function (like you did for year) to go from month1 to month2 at midnight (for example, July1 12:00AM to Aug1 12:00AM.
&gt;
where
	end_time &gt;= TRUNC(ADD_MONTHS(SYSDATE, -1),&#039;MM&#039;) AND
	end_time &lt;= TRUNC(SYSDATE,&#039;MM&#039;);

That is, in this &#039;month&#039; example, you go to the last day, but midnight of the last day of the month doesn&#039;t include that last 24hr day...I think....</description>
		<content:encoded><![CDATA[<p>Love this!  One modification I have is to &#8216;include&#8217; the last day of the month by using the TRUNC function (like you did for year) to go from month1 to month2 at midnight (for example, July1 12:00AM to Aug1 12:00AM.<br />
&gt;<br />
where<br />
	end_time &gt;= TRUNC(ADD_MONTHS(SYSDATE, -1),&#8217;MM&#8217;) AND<br />
	end_time &lt;= TRUNC(SYSDATE,&#039;MM&#039;);</p>
<p>That is, in this &#039;month&#039; example, you go to the last day, but midnight of the last day of the month doesn&#039;t include that last 24hr day&#8230;I think&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gfichtne</title>
		<link>http://edwardawebb.com/database-tips/sysdate-determine-start-previous-month-year-oracle-sql/comment-page-1/#comment-2863</link>
		<dc:creator>gfichtne</dc:creator>
		<pubDate>Fri, 13 May 2011 11:40:37 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=454#comment-2863</guid>
		<description>Perfect - thanks so much for sharing.</description>
		<content:encoded><![CDATA[<p>Perfect &#8211; thanks so much for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jtaylor</title>
		<link>http://edwardawebb.com/database-tips/sysdate-determine-start-previous-month-year-oracle-sql/comment-page-1/#comment-426</link>
		<dc:creator>jtaylor</dc:creator>
		<pubDate>Tue, 31 Mar 2009 19:07:26 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=454#comment-426</guid>
		<description>Thank you! It took me a long time to find, but this is just what I needed.</description>
		<content:encoded><![CDATA[<p>Thank you! It took me a long time to find, but this is just what I needed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

