<?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 variable not working in SQl query calling through Qlik in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517442#M14880</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/287989"&gt;@smandar91&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which flavour of SQL is it that you are using? This will inform the syntax that you need to use.&lt;/P&gt;&lt;P&gt;Trying the query in the query analyser that comes with the database will be a good start, to check that you have the syntax and date format correct.&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
    <pubDate>Mon, 12 May 2025 07:07:25 GMT</pubDate>
    <dc:creator>stevedark</dc:creator>
    <dc:date>2025-05-12T07:07:25Z</dc:date>
    <item>
      <title>Date variable not working in SQl query calling through Qlik</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517113#M14870</link>
      <description>&lt;P&gt;I'm trying one direct query in Qlik as i need real time data. Everything seems fine only variable is not working in Sql query.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;This is expeted date format: SET DateFormat='M/D/YYYY';&lt;/P&gt;&lt;P&gt;Sql query where its working --&amp;gt;where&amp;nbsp;TRANSACTION_DATE=TRUNC(SYSDATE)&lt;/P&gt;&lt;P&gt;Sql query where its failing --&amp;gt;where TRANSACTION_DATE= TRUNC('$(vLastWorkingDate)')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you elaborate same?&lt;/P&gt;&lt;P&gt;Last working date:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="smandar91_0-1746701115250.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/180317iE08529D061F7791C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="smandar91_0-1746701115250.png" alt="smandar91_0-1746701115250.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 10:46:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517113#M14870</guid>
      <dc:creator>smandar91</dc:creator>
      <dc:date>2025-05-08T10:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Date variable not working in SQl query calling through Qlik</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517128#M14872</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/287989"&gt;@smandar91&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;&lt;STRONG&gt;TRUNC&lt;/STRONG&gt; statement in that case is removing the time from the date, so is not required as last working date does not have a time.&lt;/P&gt;&lt;P&gt;I would try getting a query to work without the variable first, hardcoding the date.&lt;/P&gt;&lt;P&gt;The exact syntax will depend on the flavour of SQL. I would try having the date as 2025-05-08, for instance, or removing the quotation marks and putting the date in as a number, today is 45785.&lt;/P&gt;&lt;P&gt;Once you have got this working with a hardcoded value you can then get the variable in the correct format, either using the&amp;nbsp;&lt;STRONG&gt;date&amp;nbsp;&lt;/STRONG&gt;function or multiplying the value by 1.&lt;/P&gt;&lt;P&gt;Hope that helps point you in the right direction.&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 12:45:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517128#M14872</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2025-05-08T12:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Date variable not working in SQl query calling through Qlik</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517441#M14879</link>
      <description>&lt;P&gt;Hi Thanks for revert , This is how SQL date is coming in Qlik if i don't do any transformation Transaction Date =&amp;nbsp;2025-05-08 00:00:00.000000&lt;/P&gt;&lt;P&gt;Tried with following hardcoded values&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;2025-05-08&lt;/LI&gt;&lt;LI&gt;2025-05-08 00:00:00.000000&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;45785&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;With quotes without quotes. still no success. There is data for following date in table.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any idea what am i missing here?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 07:01:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517441#M14879</guid>
      <dc:creator>smandar91</dc:creator>
      <dc:date>2025-05-12T07:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Date variable not working in SQl query calling through Qlik</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517442#M14880</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/287989"&gt;@smandar91&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which flavour of SQL is it that you are using? This will inform the syntax that you need to use.&lt;/P&gt;&lt;P&gt;Trying the query in the query analyser that comes with the database will be a good start, to check that you have the syntax and date format correct.&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 07:07:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517442#M14880</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2025-05-12T07:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Date variable not working in SQl query calling through Qlik</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517446#M14881</link>
      <description>&lt;P&gt;Unfortunately, i don't access to Db. not sure if this helps&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="smandar91_0-1747034750959.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/180420iFBAF1F0E296220F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="smandar91_0-1747034750959.png" alt="smandar91_0-1747034750959.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also tried this part&lt;/P&gt;&lt;P&gt;&amp;nbsp;Let vLastWorkingDate = timestamp(date(Peek('NewPBDate', 0, 'Final_Cal')),'YYYY-MM-DD hh:mm:ss.ffffff'); Still the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 07:32:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517446#M14881</guid>
      <dc:creator>smandar91</dc:creator>
      <dc:date>2025-05-12T07:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Date variable not working in SQl query calling through Qlik</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517451#M14882</link>
      <description>&lt;P&gt;thanks to&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6748"&gt;@stevedark&lt;/a&gt;&amp;nbsp; and Chatgpt , Follwing works :&lt;/P&gt;&lt;P&gt;TRANSACTION_DATE = To_TIMESTAMP('$(vLastWorkingDate)', 'YYYY-MM-DD HH24:MI:SS.FF6')&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 08:01:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517451#M14882</guid>
      <dc:creator>smandar91</dc:creator>
      <dc:date>2025-05-12T08:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Date variable not working in SQl query calling through Qlik</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517452#M14883</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/287989"&gt;@smandar91&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for letting me know it's now working. Pleased to be mentioned in such esteemed company as ChatGPT!&lt;/P&gt;&lt;P&gt;You appear to be using Oracle, which does have it's own peculiarities. I should have guessed at this from the upper case field name in your query.&lt;/P&gt;&lt;P&gt;Glad it's working now.&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 08:05:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Date-variable-not-working-in-SQl-query-calling-through-Qlik/m-p/2517452#M14883</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2025-05-12T08:05:54Z</dc:date>
    </item>
  </channel>
</rss>

