<?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 date format error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/date-format-error/m-p/781871#M276912</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to pass variable vDate in my sql in script. But somehow &lt;STRONG style="font-size: 13.3333330154419px;"&gt;$(vDate)-5 &lt;/STRONG&gt;doesnt seem to work.Can someone help me here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select distinct abc from (&lt;/P&gt;&lt;P&gt;&amp;nbsp; select distinct&lt;/P&gt;&lt;P&gt;&amp;nbsp; xyz, abc, ert,zqw,wer,qwt&lt;/P&gt;&lt;P&gt;&amp;nbsp; from t1, t2&lt;/P&gt;&lt;P&gt;where name = 'PLN'&lt;/P&gt;&lt;P&gt;and&amp;nbsp; trunc(day_date) &amp;gt;=trunc(to_date(&lt;STRONG&gt;'$(vDate)-5'&lt;/STRONG&gt;,'$(QDateFormat)'))// --'08-Mar-2015'//--trunc(sysdate-5)&lt;/P&gt;&lt;P&gt;and&amp;nbsp; trunc(day_date) &amp;lt;= trunc(to_date('$(vDate)','$(QDateFormat)'))// --'13-Mar-2015'//--trunc(sysdate)&lt;/P&gt;&lt;P&gt;group by name, xyz&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Mar 2015 17:54:46 GMT</pubDate>
    <dc:creator>rdsuperlike</dc:creator>
    <dc:date>2015-03-24T17:54:46Z</dc:date>
    <item>
      <title>date format error</title>
      <link>https://community.qlik.com/t5/QlikView/date-format-error/m-p/781871#M276912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to pass variable vDate in my sql in script. But somehow &lt;STRONG style="font-size: 13.3333330154419px;"&gt;$(vDate)-5 &lt;/STRONG&gt;doesnt seem to work.Can someone help me here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select distinct abc from (&lt;/P&gt;&lt;P&gt;&amp;nbsp; select distinct&lt;/P&gt;&lt;P&gt;&amp;nbsp; xyz, abc, ert,zqw,wer,qwt&lt;/P&gt;&lt;P&gt;&amp;nbsp; from t1, t2&lt;/P&gt;&lt;P&gt;where name = 'PLN'&lt;/P&gt;&lt;P&gt;and&amp;nbsp; trunc(day_date) &amp;gt;=trunc(to_date(&lt;STRONG&gt;'$(vDate)-5'&lt;/STRONG&gt;,'$(QDateFormat)'))// --'08-Mar-2015'//--trunc(sysdate-5)&lt;/P&gt;&lt;P&gt;and&amp;nbsp; trunc(day_date) &amp;lt;= trunc(to_date('$(vDate)','$(QDateFormat)'))// --'13-Mar-2015'//--trunc(sysdate)&lt;/P&gt;&lt;P&gt;group by name, xyz&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2015 17:54:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/date-format-error/m-p/781871#M276912</guid>
      <dc:creator>rdsuperlike</dc:creator>
      <dc:date>2015-03-24T17:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: date format error</title>
      <link>https://community.qlik.com/t5/QlikView/date-format-error/m-p/781872#M276913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use to_char instead of to_date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Av7eN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2015 18:01:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/date-format-error/m-p/781872#M276913</guid>
      <dc:creator>aveeeeeee7en</dc:creator>
      <dc:date>2015-03-24T18:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: date format error</title>
      <link>https://community.qlik.com/t5/QlikView/date-format-error/m-p/781873#M276914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I think that the following part of your SQL creates a problem:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;trunc(to_date(&lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;'$(vDate)-5'&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;,'$(QDateFormat)'))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I am pretty sure the it will be like this after QlikView has done it's $-sign exansion:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trunc(to_date('&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;08-Mar-2015-5&lt;/STRONG&gt;',.......&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;And your SQL database (Oracle I presume...) will be left to try to interpret what 08-Mar-2015-5 means.... It will not&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;subtract 5 days from 8th of March which you intend...&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I think this may be the syntax you have to use:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG&gt;trunc( to_date( '$(vDate)' , '$(QDateFormat)' ) - interval '5' days )&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Hope this helps...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2015 18:41:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/date-format-error/m-p/781873#M276914</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-03-24T18:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: date format error</title>
      <link>https://community.qlik.com/t5/QlikView/date-format-error/m-p/781874#M276915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;let vDateMinus5 = date(today()-5, '&lt;STRONG&gt;YYYYMMDD&lt;/STRONG&gt;'); &lt;/P&gt;&lt;P&gt;TRACE $(vDateMinus5);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT &lt;/P&gt;&lt;P&gt;DAY_DATE,&lt;/P&gt;&lt;P&gt;to_char(DAY_DATE, 'YYYYMM') as DAY_DATE_CHAR&lt;/P&gt;&lt;P&gt;FROM TEST.TEST&lt;/P&gt;&lt;P&gt;where trunc(DAY_DATE) &amp;lt;= to_date('$(vDateMinus5)', '&lt;STRONG&gt;YYYYMMDD&lt;/STRONG&gt;')&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2015 19:07:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/date-format-error/m-p/781874#M276915</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-03-24T19:07:53Z</dc:date>
    </item>
  </channel>
</rss>

