﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Teradata Forums / Data Warehousing  / Teradata   / SQL query to Teradata SQL / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Teradata Forums</description><link>http://www.teradata.com/teradataforum/</link><webMaster>info@teradata.com</webMaster><lastBuildDate>Wed, 03 Dec 2008 19:47:29 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: SQL query to Teradata SQL</title><link>http://www.teradata.com/teradataforum/Topic10483-1-1.aspx</link><description>r_update_date is a CHAR datatype.</description><pubDate>Mon, 04 Feb 2008 01:58:40 GMT</pubDate><dc:creator>Rakesh nc</dc:creator></item><item><title>RE: SQL query to Teradata SQL</title><link>http://www.teradata.com/teradataforum/Topic10483-1-1.aspx</link><description>Hi Rakesh,what's the datatype of r_update_date, it can't be datetime, looks like an integer/decimal with julian day within year and that dateadd converts it to a date?  CURRENT_DATE - CAST(CAST(r_update_date AS CHAR(7)) AS DATE FORMAT 'yyyyddd')Dieter</description><pubDate>Sat, 02 Feb 2008 09:30:24 GMT</pubDate><dc:creator>dnoeth</dc:creator></item><item><title>SQL query to Teradata SQL</title><link>http://www.teradata.com/teradataforum/Topic10483-1-1.aspx</link><description>hi,pls convert the following SQL queries to Teradata SQL.1.DATEDIFF(day,dateadd ( dd , ( r_update_date % 1000 ) - 1 , convert ( datetime ,convert( char(4) , r_update_date / 1000 ) + '/01/01') ) , GETDATE()) &amp;gt; 90[/b][/i]2. datepart(d,dateadd(day,-datepart(d,getdate()),getdate());</description><pubDate>Sat, 02 Feb 2008 05:26:18 GMT</pubDate><dc:creator>Rakesh nc</dc:creator></item></channel></rss>