<?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: Error using SQL query in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Error-using-SQL-query/m-p/1837419#M69228</link>
    <description>&lt;P&gt;Date() and Date#() is qlik defined function. It won't work in Oracle&lt;/P&gt;&lt;P&gt;you have to see for equivalent function in oracle. I think to_date() and to_char() function work similar in oracle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to debug you code first run your query in oracle ( if you have toad then run in toad or similar IDE)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant Sangle&lt;/P&gt;</description>
    <pubDate>Mon, 20 Sep 2021 05:55:18 GMT</pubDate>
    <dc:creator>PrashantSangle</dc:creator>
    <dc:date>2021-09-20T05:55:18Z</dc:date>
    <item>
      <title>Error using SQL query</title>
      <link>https://community.qlik.com/t5/App-Development/Error-using-SQL-query/m-p/1837393#M69227</link>
      <description>&lt;P&gt;Hi, I have a query error when i tried to filter date and query data from oracle db.&lt;/P&gt;&lt;P&gt;I've tried the same query using data from csv file, and the query succeed. but not when i try to use the same data, but different source from oracle db straight away.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is the error shown.&lt;/P&gt;&lt;P&gt;Here's my query when i use csv file:&lt;/P&gt;&lt;P&gt;Let vStartDate = MakeDate(2021,9,17);&lt;/P&gt;&lt;P&gt;Let vAfterDate = Interval(Today() - Floor(vStartDate), 'D');&lt;/P&gt;&lt;P&gt;Let vBeforeDate = vStartDate - (vAfterDate + 1) ;&lt;/P&gt;&lt;P&gt;Proposal1:&lt;BR /&gt;LOAD STRPROPNBR,&lt;BR /&gt;Date#(DTPROPENTRY, 'DDMMMYYYY:hh:mm:ss') as DTPROPENTRY,&lt;BR /&gt;Date(Date#(DTPROPENTRY, 'DDMMMYYYY:hh:mm:ss'), 'DD/MM/YYYY') as DTPROPENTRY2,&lt;BR /&gt;If (Date(Date#(DTPROPENTRY, 'DDMMMYYYY:hh:mm:ss')) &amp;lt; Date('$(vStartDate)','DD-MM-YYYY'), 'Before', 'After') as PERIOD,&lt;BR /&gt;DTPROPSIGNED,&lt;BR /&gt;STRCLIENTCD,&lt;BR /&gt;NPROPSTATCD,&lt;BR /&gt;DTPROPSTAT,&lt;BR /&gt;DTINFORCE,&lt;BR /&gt;STRCMPNYBRANCHCD&lt;BR /&gt;FROM&lt;BR /&gt;[C:\Users\00137174\Desktop\IUW\Data QV 2\IL_NB_BASE_PROP_DTL.csv]&lt;BR /&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq)&lt;BR /&gt;where Date(Date#(DTPROPENTRY, 'DDMMMYYYY:hh:mm:ss')) &amp;gt;= Date($(vBeforeDate),'DD-MM-YYYY');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the query using data from oracle db:&lt;/P&gt;&lt;P&gt;Let vStartDate = MakeDate(2021,9,17);&lt;/P&gt;&lt;P&gt;Let vAfterDate = Interval(Today() - Floor(vStartDate), 'D');&lt;/P&gt;&lt;P&gt;Let vBeforeDate = vStartDate - (vAfterDate + 1) ;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO [Staging;DBQ=EBIPROD_SUN] (XUserId is XdMaNIZIQBMCTZcGRZNIDaD, XPassword is cfCRRDdNMDZeVYIGTBNcE);&lt;/P&gt;&lt;P&gt;Proposal1:&lt;BR /&gt;SQL select STRPROPNBR,&lt;BR /&gt;DTPROPENTRY,&lt;BR /&gt;Date(Date#(DTPROPENTRY, 'DDMMMYYYY:hh:mm:ss'), 'DD/MM/YYYY') as DTPROPENTRY2,&lt;BR /&gt;If ((DTPROPENTRY) &amp;lt; Date('$(vStartDate)','DD-MM-YYYY'), 'Before', 'After') as PERIOD,&lt;BR /&gt;DTPROPSIGNED,&lt;BR /&gt;STRCLIENTCD,&lt;BR /&gt;NPROPSTATCD,&lt;BR /&gt;DTPROPSTAT,&lt;BR /&gt;DTINFORCE,&lt;BR /&gt;STRCMPNYBRANCHCD&lt;BR /&gt;FROM "ADM_STG"."IL_NB_BASE_PROP_DTL"&lt;BR /&gt;where DTPROPENTRY &amp;gt;= &amp;gt;= Date($(vBeforeDate),'DD-MM-YYYY');&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-inline" image-alt="Amelia_96_0-1632102750683.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/62285i9B15BE7D6E7345DD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amelia_96_0-1632102750683.png" alt="Amelia_96_0-1632102750683.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;Really appreciate a fast response from anyone who can help me to fix this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Amelia&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 16:59:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Error-using-SQL-query/m-p/1837393#M69227</guid>
      <dc:creator>Amelia_96</dc:creator>
      <dc:date>2024-11-16T16:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Error using SQL query</title>
      <link>https://community.qlik.com/t5/App-Development/Error-using-SQL-query/m-p/1837419#M69228</link>
      <description>&lt;P&gt;Date() and Date#() is qlik defined function. It won't work in Oracle&lt;/P&gt;&lt;P&gt;you have to see for equivalent function in oracle. I think to_date() and to_char() function work similar in oracle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to debug you code first run your query in oracle ( if you have toad then run in toad or similar IDE)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant Sangle&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 05:55:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Error-using-SQL-query/m-p/1837419#M69228</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2021-09-20T05:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Error using SQL query</title>
      <link>https://community.qlik.com/t5/App-Development/Error-using-SQL-query/m-p/1837444#M69229</link>
      <description>&lt;P&gt;An alternatively to the use of native database-functions would be not to transform the fields within the sql else within Qlik within a preceeding load on top of the sql. See here what is meant:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Preceding-Load/ba-p/1469534" target="_blank"&gt;Preceding Load - Qlik Community - 1469534&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 06:52:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Error-using-SQL-query/m-p/1837444#M69229</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-09-20T06:52:41Z</dc:date>
    </item>
  </channel>
</rss>

