<?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: Convert cahr field to datetime</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/convert-cahr-field-to-datetime/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/convert-cahr-field-to-datetime/</link>
	<description></description>
	<lastBuildDate>Thu, 20 Jun 2013 03:04:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: tracyp</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/convert-cahr-field-to-datetime/#comment-37540</link>
		<dc:creator>tracyp</dc:creator>
		<pubDate>Sat, 03 Jun 2006 16:25:07 +0000</pubDate>
		<guid isPermaLink="false">#comment-37540</guid>
		<description><![CDATA[You could also use the IN operator:
SELECT (field list)
FROM MyTable
WHERE MyDateField IN (&#039;10512&#039;,&#039;10601&#039;,&#039;10602&#039;,&#039;10603&#039;,&#039;10604&#039;,&#039;10605&#039;)

Lots of solutions!  Have fun!
~~~Tracy]]></description>
		<content:encoded><![CDATA[<p>You could also use the IN operator:<br />
SELECT (field list)<br />
FROM MyTable<br />
WHERE MyDateField IN (&#8217;10512&#8242;,&#8217;10601&#8242;,&#8217;10602&#8242;,&#8217;10603&#8242;,&#8217;10604&#8242;,&#8217;10605&#8242;)</p>
<p>Lots of solutions!  Have fun!<br />
~~~Tracy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tommie</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/convert-cahr-field-to-datetime/#comment-37541</link>
		<dc:creator>tommie</dc:creator>
		<pubDate>Fri, 02 Jun 2006 09:44:48 +0000</pubDate>
		<guid isPermaLink="false">#comment-37541</guid>
		<description><![CDATA[I had a similar situation.  Simply convert your character variable to a dec character.  Convert your Year/Month to a CYYMMDD format.  Then convert to a date.  I did this in a DB2 SQL stored procedure and called a sql UDF.  

DECLARE PERIOD CHAR ( 4 );
DECLARE YRMTH DEC ( 4 ) ;

SET YRMTH = CAST ( PERIOD AS NUMERIC ( 4 , 0 ) ) ;
SET MTHBEG = ( YRMTH * 100 ) + 1000001 ;


CREATE FUNCTION PEGGYB.DEC2DATE ( 
DATEDEC DECIMAL(7, 0) ) 

	RETURNS DATE   

	LANGUAGE SQL 
.
.
.
BEGIN 
/*This function converts a 7 digit date to a Date data type*/ 
/*ONLY WORKS FOR DATE &gt;1939 &amp; ]]></description>
		<content:encoded><![CDATA[<p>I had a similar situation.  Simply convert your character variable to a dec character.  Convert your Year/Month to a CYYMMDD format.  Then convert to a date.  I did this in a DB2 SQL stored procedure and called a sql UDF.  </p>
<p>DECLARE PERIOD CHAR ( 4 );<br />
DECLARE YRMTH DEC ( 4 ) ;</p>
<p>SET YRMTH = CAST ( PERIOD AS NUMERIC ( 4 , 0 ) ) ;<br />
SET MTHBEG = ( YRMTH * 100 ) + 1000001 ;</p>
<p>CREATE FUNCTION PEGGYB.DEC2DATE (<br />
DATEDEC DECIMAL(7, 0) ) </p>
<p>	RETURNS DATE   </p>
<p>	LANGUAGE SQL<br />
.<br />
.<br />
.<br />
BEGIN<br />
/*This function converts a 7 digit date to a Date data type*/<br />
/*ONLY WORKS FOR DATE &gt;1939 &amp; </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ethacke1</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/convert-cahr-field-to-datetime/#comment-37542</link>
		<dc:creator>ethacke1</dc:creator>
		<pubDate>Fri, 02 Jun 2006 08:50:13 +0000</pubDate>
		<guid isPermaLink="false">#comment-37542</guid>
		<description><![CDATA[You may just want to use the &#039;between&#039; keyword in SQL (criteria) for an easy solution:

e.g., where (field) between &#039;10512&#039; and &#039;10605&#039; for the months of December 2005 - May of 2006

(&#039;between&#039; will, in effect, pull data that is &gt;= the minimum value and ]]></description>
		<content:encoded><![CDATA[<p>You may just want to use the &#8216;between&#8217; keyword in SQL (criteria) for an easy solution:</p>
<p>e.g., where (field) between &#8217;10512&#8242; and &#8217;10605&#8242; for the months of December 2005 &#8211; May of 2006</p>
<p>(&#8216;between&#8217; will, in effect, pull data that is &gt;= the minimum value and </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 6/9 queries in 0.012 seconds using memcached
Object Caching 296/299 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-06-20 03:26:41 -->