 




<?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: Find # days between 2 dates in Query 400</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/find-sharp-days-between-2-dates-in-query-400-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/find-sharp-days-between-2-dates-in-query-400-2/</link>
	<description></description>
	<lastBuildDate>Wed, 22 May 2013 02:14:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: rosshowatson</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/find-sharp-days-between-2-dates-in-query-400-2/#comment-76400</link>
		<dc:creator>rosshowatson</dc:creator>
		<pubDate>Fri, 23 Apr 2010 14:45:01 +0000</pubDate>
		<guid isPermaLink="false">#comment-76400</guid>
		<description><![CDATA[If the fields are defined as character then convert the date field to a YYYY-MM-DD format (include the - symbol) via a Define Result Fields as follows:
OLDESTCHR1      substr(chr1,1,4) &#124;&#124; &#039;-&#039; &#124;&#124;     
                             substr(chr1,5,2) &#124;&#124; &#039;-&#039; &#124;&#124;     
                             substr(chr1,7,2)
(change the start positions accordingly).  
Do the above for both date fields.
DATECHRDIF      date(OLDESTCHR2) - 
                            date(OLDESTCHR1)   

This will give you the number of days between two dates (0 days when dates are the same).

If the fields are already defined as date (in YYYY-MM-DD format) then the formula is as follows:
DATEDIFF      DateField2 - DateField1]]></description>
		<content:encoded><![CDATA[<p>If the fields are defined as character then convert the date field to a YYYY-MM-DD format (include the &#8211; symbol) via a Define Result Fields as follows:<br />
OLDESTCHR1      substr(chr1,1,4) || &#8216;-&#8217; ||<br />
                             substr(chr1,5,2) || &#8216;-&#8217; ||<br />
                             substr(chr1,7,2)<br />
(change the start positions accordingly).<br />
Do the above for both date fields.<br />
DATECHRDIF      date(OLDESTCHR2) &#8211;<br />
                            date(OLDESTCHR1)   </p>
<p>This will give you the number of days between two dates (0 days when dates are the same).</p>
<p>If the fields are already defined as date (in YYYY-MM-DD format) then the formula is as follows:<br />
DATEDIFF      DateField2 &#8211; DateField1</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/8 queries in 0.044 seconds using memcached
Object Caching 267/268 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-22 04:08:16 -->