<?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: How to compare 2 dates in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-compare-2-dates/m-p/2354325#M120328</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; I considered your first expression as the base logic and I have created the job as shown below. Its working for both conditions.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 833px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5Tu.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128065i17D1D672F1370D52/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5Tu.png" alt="0683p000009M5Tu.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&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: 827px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5U8.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154205i48A20B9501A644C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5U8.png" alt="0683p000009M5U8.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;You had specified that your input data is already in date data type. So you do not have to specify date format while doing date comparison. That was the issue in original flow.&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="0683p000009M5UD.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149971i1454A4676F1E3B18/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5UD.png" alt="0683p000009M5UD.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;!(Relational.ISNULL(row2.UPDT_DTTM)) &amp;amp;&amp;amp; TalendDate.compareDate(row2.CREATED_DTTM,row2.END_DTTM)&amp;lt;=0 &amp;amp;&amp;amp;
TalendDate.compareDate(TalendDate.getCurrentDate(),row2.UPDT_DTTM)&amp;gt;=0 &amp;amp;&amp;amp; TalendDate.compareDate(row2.UPDT_DTTM,row2.END_DTTM)&amp;gt;=0 ? "a":"b" &lt;/PRE&gt; 
&lt;P&gt;Please spare a second to mark the post as resolved if you are happy &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&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>Thu, 06 Jun 2019 21:18:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-06-06T21:18:23Z</dc:date>
    <item>
      <title>How to compare 2 dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-compare-2-dates/m-p/2354323#M120326</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;I am not able to compare 2 date which is retuning string as output in if else statement in tmap.&lt;/P&gt; 
&lt;P&gt;I tried below 2 expression but it is not working.&lt;/P&gt; 
&lt;P&gt;1. &amp;nbsp;!(Relational.ISNULL(lnk_AllData.UPDT_DTTM)) &amp;amp;&amp;amp; lnk_AllData.CREATED_DTTM &amp;lt;= lnk_AllData.END_DTTM &amp;amp;&amp;amp; TalendDate.getCurrentDate() &amp;gt;= lnk_AllData.UPDT_DTTM &amp;amp;&amp;amp;&lt;BR /&gt;lnk_AllData.UPDT_DTTM &amp;gt; lnk_AllData.END_DTTM ? "a":"b"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;2 .&amp;nbsp;&amp;nbsp; &amp;nbsp;((TalendDate.compareDate(lnk_AllData.CREATED_DTTM,lnk_AllData.END_DTTM,"yyyy-MM-dd HH:mm:ss")==0 || TalendDate.compareDate(lnk_AllData.CREATED_DTTM,lnk_AllData.END_DTTM,"yyyy-MM-dd HH:mm:ss"==-1)) &amp;amp;&amp;amp; (TalendDate.compareDate(TalendDate.getCurrentDate(),lnk_AllData.UPDT_DTTM,"yyyy-MM-dd HH:mm:ss")==0 || TalendDate.compareDate(TalendDate.getCurrentDate(),lnk_AllData.UPDT_DTTM,"yyyy-MM-dd HH:mm:ss" ==1)) &amp;amp;&amp;amp; (TalendDate.compareDate(lnk_AllData.UPDT_DTTM,lnk_AllData.END_DTTM),"yyyy-MM-dd HH:mm:ss"==1))?"a":"b"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;and all datatype of date columns is date&lt;/P&gt; 
&lt;P&gt;please help&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 06:31:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-compare-2-dates/m-p/2354323#M120326</guid>
      <dc:creator>rohit1804</dc:creator>
      <dc:date>2019-06-06T06:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare 2 dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-compare-2-dates/m-p/2354324#M120327</link>
      <description>Can you explain what do you want to do with the formula? What are fields and the output required?</description>
      <pubDate>Thu, 06 Jun 2019 07:58:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-compare-2-dates/m-p/2354324#M120327</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-06T07:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare 2 dates</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-compare-2-dates/m-p/2354325#M120328</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; I considered your first expression as the base logic and I have created the job as shown below. Its working for both conditions.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 833px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5Tu.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128065i17D1D672F1370D52/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5Tu.png" alt="0683p000009M5Tu.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&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: 827px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5U8.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154205i48A20B9501A644C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5U8.png" alt="0683p000009M5U8.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;You had specified that your input data is already in date data type. So you do not have to specify date format while doing date comparison. That was the issue in original flow.&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="0683p000009M5UD.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149971i1454A4676F1E3B18/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5UD.png" alt="0683p000009M5UD.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;!(Relational.ISNULL(row2.UPDT_DTTM)) &amp;amp;&amp;amp; TalendDate.compareDate(row2.CREATED_DTTM,row2.END_DTTM)&amp;lt;=0 &amp;amp;&amp;amp;
TalendDate.compareDate(TalendDate.getCurrentDate(),row2.UPDT_DTTM)&amp;gt;=0 &amp;amp;&amp;amp; TalendDate.compareDate(row2.UPDT_DTTM,row2.END_DTTM)&amp;gt;=0 ? "a":"b" &lt;/PRE&gt; 
&lt;P&gt;Please spare a second to mark the post as resolved if you are happy &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&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>Thu, 06 Jun 2019 21:18:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-compare-2-dates/m-p/2354325#M120328</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-06T21:18:23Z</dc:date>
    </item>
  </channel>
</rss>

