<?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: Compare Dates in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371454#M134396</link>
    <description>My date in the stream is in the format DD-MM-YYYY, but for comparison, I set the pattern "yyyy-MM-dd"&amp;nbsp; 
&lt;BR /&gt;I do not know why that compares first at the level of the day, then months, and finally to year. .&amp;nbsp; 
&lt;BR /&gt;How should I have a set pattern in the stream compared to me right? 
&lt;BR /&gt;Or what could be wrong?</description>
    <pubDate>Thu, 31 Jul 2014 13:04:44 GMT</pubDate>
    <dc:creator>peterko</dc:creator>
    <dc:date>2014-07-31T13:04:44Z</dc:date>
    <item>
      <title>Compare Dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371448#M134390</link>
      <description>Hello,&lt;BR /&gt;how do I compare two dates?&lt;BR /&gt;I would like something like this in my tMap:&lt;BR /&gt;&lt;PRE&gt;TalendDate.compareDate(TalendDate.getDate("dd-MM-yyyy"), row1.service_date, "dd-MM-yyyy") &amp;gt; 0 ? TalendDate.getDate("dd-MM-yyyy") : row1.service_date&lt;/PRE&gt;&lt;BR /&gt;where row1.service_date is a date, and I save the result to columns of type date.&lt;BR /&gt;But I still writes error "Exception in thread" main "java.lang.Error: unresolved compilation problems"</description>
      <pubDate>Thu, 31 Jul 2014 00:19:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371448#M134390</guid>
      <dc:creator>peterko</dc:creator>
      <dc:date>2014-07-31T00:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371449#M134391</link>
      <description>The method&amp;nbsp; 
&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;TalendDate.getDate("dd-MM-yyyy") returns a string, not a Date. Try this expression:&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;TalendDate.compareDate(TalendDate.getCurrentDate(), row1.service_date)&amp;gt;0?TalendDate.getCurrentDate(): sOrders.serviced_at&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT face="consolas, monaco, bitstream vera sans mono, courier new, courier, monospace"&gt;Best regards&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT face="consolas, monaco, bitstream vera sans mono, courier new, courier, monospace"&gt;Shong&lt;/FONT&gt;</description>
      <pubDate>Thu, 31 Jul 2014 02:47:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371449#M134391</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-31T02:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371450#M134392</link>
      <description>I'm constantly throwing error: 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/207884/dateCompare.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEeQ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155116i175562966319DF16/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEeQ.png" alt="0683p000009MEeQ.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/A&gt;</description>
      <pubDate>Thu, 31 Jul 2014 10:56:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371450#M134392</guid>
      <dc:creator>peterko</dc:creator>
      <dc:date>2014-07-31T10:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371451#M134393</link>
      <description>Hi,&lt;BR /&gt;If you test in tMap for your incoming data, then this error may come... whether same error appears after executing complete job?&lt;BR /&gt;Vaibhav</description>
      <pubDate>Thu, 31 Jul 2014 11:31:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371451#M134393</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-31T11:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371452#M134394</link>
      <description>&lt;PRE&gt;TalendDate.compareDate(TalendDate.parseDate("yyyy-MM-dd", TalendDate.getDate("yyyy-MM-dd")), row1.service_date, "yyyy-MM-dd") &amp;gt; 0 ? TalendDate.parseDate("yyyy-MM-dd", TalendDate.getDate("yyyy-MM-dd")) : row1.service_date &lt;/PRE&gt;
&lt;BR /&gt;When I run it out of tMap, then is not error.
&lt;BR /&gt;But comparison is not correct. I have always found it assigns the current date and not older.</description>
      <pubDate>Thu, 31 Jul 2014 11:37:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371452#M134394</guid>
      <dc:creator>peterko</dc:creator>
      <dc:date>2014-07-31T11:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371453#M134395</link>
      <description>Hi,&lt;BR /&gt;I have checked with fixedflowinput--&amp;gt;tJavaRow and date set to 2014-06-01 and 2014-08-01 with following code&lt;BR /&gt;System.out.println(TalendDate.compareDate(TalendDate.parseDate("yyyy-MM-dd", TalendDate.getDate("yyyy-MM-dd")), input_row.service_date, "yyyy-MM-dd") &amp;gt; 0 ? TalendDate.parseDate("yyyy-MM-dd", TalendDate.getDate("yyyy-MM-dd")) : input_row.service_date);&lt;BR /&gt;This works... i get expected results with those values...&lt;BR /&gt;Thanks&lt;BR /&gt;Vaibhav</description>
      <pubDate>Thu, 31 Jul 2014 12:08:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371453#M134395</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-31T12:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371454#M134396</link>
      <description>My date in the stream is in the format DD-MM-YYYY, but for comparison, I set the pattern "yyyy-MM-dd"&amp;nbsp; 
&lt;BR /&gt;I do not know why that compares first at the level of the day, then months, and finally to year. .&amp;nbsp; 
&lt;BR /&gt;How should I have a set pattern in the stream compared to me right? 
&lt;BR /&gt;Or what could be wrong?</description>
      <pubDate>Thu, 31 Jul 2014 13:04:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371454#M134396</guid>
      <dc:creator>peterko</dc:creator>
      <dc:date>2014-07-31T13:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371455#M134397</link>
      <description>You will have to stick to the incoming date format.... for comparison, talend will not care what format you have... Set any standard format and you get proper results... Metadata must match.
&lt;BR /&gt;Vaibhav</description>
      <pubDate>Thu, 31 Jul 2014 13:10:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371455#M134397</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-31T13:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371456#M134398</link>
      <description>When I have everything in the same format "dd-MM-yyyy", as well as to compare it first to the day level, at the level of the month, and eventually to the level a year. For example, the date1 is 15-05-2010 and date2 is 15-01-2014, as earlier is evaluated date2.
&lt;BR /&gt;Format "dd-MM-yyyy" for stream I got like a "Retrieve schema" from database connection.</description>
      <pubDate>Thu, 31 Jul 2014 14:09:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371456#M134398</guid>
      <dc:creator>peterko</dc:creator>
      <dc:date>2014-07-31T14:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371457#M134399</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;&lt;PRE&gt;TalendDate.compareDate(TalendDate.parseDate("yyyy-MM-dd", TalendDate.getDate("yyyy-MM-dd")), row1.service_date, "yyyy-MM-dd") &amp;gt; 0 ? TalendDate.parseDate("yyyy-MM-dd", TalendDate.getDate("yyyy-MM-dd")) : row1.service_date &lt;/PRE&gt;&lt;BR /&gt;When I run it out of tMap, then is not error.&lt;BR /&gt;But comparison is not correct. I have always found it assigns the current date and not older.&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;TalendDate.getDate() returns the current date, do there exists service_date in your input data bigger than current date? if not, it is normal with this expression, it always output the current date. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Sat, 02 Aug 2014 02:13:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371457#M134399</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-02T02:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371458#M134400</link>
      <description>&lt;P&gt;Hi iam new to talend&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need to compare dates but iam getting error while using below qury in tmap&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TalendDate.compareDate(load_src.acctr_eff_dt &amp;lt;= context.i_DATA_DATE &amp;amp;&amp;amp; load_src.acctr_exp_dt &amp;gt;= context.i_DATA_DATE)?"Y":"N"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---- value of context.i_DATA_DATE=2018-12-31&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 15:03:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371458#M134400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-01T15:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371459#M134401</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LPKAAA4"&gt;@ris.tan&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;Please try the below logic and I got the output as shown below.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 867px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2kG.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128343i8ED5C18DE3271713/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2kG.png" alt="0683p000009M2kG.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2u9.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131652iDE93DD55FC2E1F99/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2u9.png" alt="0683p000009M2u9.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The tMap expression used in the output column is as shown below.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;(TalendDate.compareDate(row1.acctr_eff_dt,context.i_DATA_DATE)&amp;lt;=0 &amp;amp;&amp;amp; TalendDate.compareDate(row1.acctr_exp_dt,context.i_DATA_DATE)&amp;gt;=0)?"Y":"N" &lt;/PRE&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 04:21:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-Dates/m-p/2371459#M134401</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-04T04:21:14Z</dc:date>
    </item>
  </channel>
</rss>

