<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Date Difference in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Date-Difference/m-p/2323843#M93626</link>
    <description>Hi Karuetl 
&lt;BR /&gt;Before using the function diffDate, print the context variables to see if the value is assigned correctly. 
&lt;BR /&gt; 
&lt;BR /&gt;System.out.println(context.StDt); 
&lt;BR /&gt;System.out.println(context.EnDt); 
&lt;BR /&gt;context.vDiff= TalendDate.diffDate(context.StDt,context.EnDt,"dd"); 
&lt;BR /&gt;System.out.println(context.vDiff); 
&lt;BR /&gt; 
&lt;BR /&gt;About using context variable with date type in a query, it usually use a single quote to enclose the context varaible, for example: 
&lt;BR /&gt;"select c1, c2 from tableName where dateColumn&amp;gt;'"+context.dateVar+"'" 
&lt;BR /&gt; 
&lt;BR /&gt;Let me know if it works. 
&lt;BR /&gt; 
&lt;BR /&gt;Regards 
&lt;BR /&gt;Shong</description>
    <pubDate>Fri, 26 Jan 2018 01:45:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-01-26T01:45:11Z</dc:date>
    <item>
      <title>Date Difference</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-Difference/m-p/2323839#M93622</link>
      <description>&lt;P&gt;In the contexts i gave below two variables and values&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;StDt -&amp;gt; Date -&amp;gt; 01/01/2018&lt;/P&gt;&lt;P&gt;EnDt-&amp;gt; Date -&amp;gt; 01/10/2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;context.vDiff= TalendDate.diffDate(context.&lt;SPAN&gt;StDt&lt;/SPAN&gt;,context.&lt;SPAN&gt;EnDt&lt;/SPAN&gt;,"dd");&lt;BR /&gt;System.out.println(context.vDiff);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i got printed as 0&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 17:43:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-Difference/m-p/2323839#M93622</guid>
      <dc:creator>Karuetl</dc:creator>
      <dc:date>2018-01-25T17:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-Difference/m-p/2323840#M93623</link>
      <description>&lt;P&gt;You're printing vDiff, but setting the result of the date difference to diff.&amp;nbsp; Have you assigned the correct variable?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 18:13:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-Difference/m-p/2323840#M93623</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-25T18:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-Difference/m-p/2323841#M93624</link>
      <description>&lt;P&gt;Sorry it was typo&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the contexts i gave below two variables and values&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;StDt -&amp;gt; Date -&amp;gt; 01/01/2018&lt;/P&gt;&lt;P&gt;EnDt-&amp;gt; Date -&amp;gt; 01/10/2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;context.vDiff= TalendDate.diffDate(context.&lt;SPAN&gt;StDt&lt;/SPAN&gt;,context.&lt;SPAN&gt;EnDt&lt;/SPAN&gt;,"dd");&lt;BR /&gt;System.out.println(context.vDiff);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i got printed as 0&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 18:16:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-Difference/m-p/2323841#M93624</guid>
      <dc:creator>Karuetl</dc:creator>
      <dc:date>2018-01-25T18:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-Difference/m-p/2323842#M93625</link>
      <description>&lt;P&gt;Figured out that Talend is the date format as 'yyyy-MM-DD hh:mm:ss' , Even though if I give&amp;nbsp;&amp;nbsp;the value as 02/02/2018 as date for the context variable , it is not accepting the value&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Got another issue&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i run the teradata query by giving context date variable in the where clause it is throwing error as below .. Reason is Talend is printing value like&amp;nbsp;Fri Feb 20 00:00:00 EST 1981&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[FATAL]: kafka.loopjob_0_1.LoopJob - tTeradataInput_1 [Teradata Database] [TeraJDBC 15.10.00.14] [Error 3707] [SQLState 42000] Syntax error, expected something like an 'AS' keyword between the word 'Sat' and the word 'Feb'.&lt;BR /&gt;Exception in component tTeradataInput_1&lt;BR /&gt;java.sql.SQLException: [Teradata Database] [TeraJDBC 15.10.00.14] [Error 3707] [SQLState 42000] Syntax error, expected something like an 'AS' keyword between the word 'Sat' and the word 'Feb'.&lt;BR /&gt;at&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 20:20:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-Difference/m-p/2323842#M93625</guid>
      <dc:creator>Karuetl</dc:creator>
      <dc:date>2018-01-25T20:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Date Difference</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Date-Difference/m-p/2323843#M93626</link>
      <description>Hi Karuetl 
&lt;BR /&gt;Before using the function diffDate, print the context variables to see if the value is assigned correctly. 
&lt;BR /&gt; 
&lt;BR /&gt;System.out.println(context.StDt); 
&lt;BR /&gt;System.out.println(context.EnDt); 
&lt;BR /&gt;context.vDiff= TalendDate.diffDate(context.StDt,context.EnDt,"dd"); 
&lt;BR /&gt;System.out.println(context.vDiff); 
&lt;BR /&gt; 
&lt;BR /&gt;About using context variable with date type in a query, it usually use a single quote to enclose the context varaible, for example: 
&lt;BR /&gt;"select c1, c2 from tableName where dateColumn&amp;gt;'"+context.dateVar+"'" 
&lt;BR /&gt; 
&lt;BR /&gt;Let me know if it works. 
&lt;BR /&gt; 
&lt;BR /&gt;Regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Fri, 26 Jan 2018 01:45:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Date-Difference/m-p/2323843#M93626</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-26T01:45:11Z</dc:date>
    </item>
  </channel>
</rss>

