<?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: Month function in sql query where clause in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063028#M637013</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;Hi Heidi,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Change your variable like below,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vMonthStart = Date(Monthstart(today()),'D.M.YYYY h:mm:ss');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vMonthEnd = &lt;SPAN style="font-size: 13.3333px;"&gt;Date(Monthend(today()),'D.M.YYYY &lt;EM style="font-size: 13.3333px;"&gt; h:mm:ss'&lt;/EM&gt;);&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;And SQL statement like below&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM IFSAPP."GEN_LED_VOUCHER_ROW"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;WHERE VOUCHER_DATE&amp;gt; '$(vMonthStart)' and VOUCHER_DATE='$(vMonthEnd)';&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Apr 2016 10:17:21 GMT</pubDate>
    <dc:creator>tamilarasu</dc:creator>
    <dc:date>2016-04-06T10:17:21Z</dc:date>
    <item>
      <title>Month function in sql query where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063026#M637011</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;What is wrong in my where clause:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a ODBC connection and I'm trying to limit the data by year and month functions in the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;This is my where limit and the year seems to work but it gives error with the month "invalid tag".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US;"&gt;FROM IFSAPP."GEN_LED_VOUCHER_ROW"&lt;BR /&gt; WHERE YEAR(VOUCHER_DATE)=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="color: gray; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US;"&gt;$(vYear)&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US;"&gt; and MONTH(VOUCHER_DATE)=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="color: gray; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US;"&gt;$(vMonth)&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/120645_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;The variables are &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/120646_pastedImage_2.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;And the form of voucher date in the database is &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&lt;IMG class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/120650_pastedImage_3.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;What am I doing wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;Heidi&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 08:30:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063026#M637011</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-06T08:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Month function in sql query where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063027#M637012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try with single quotes&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;WHERE YEAR(VOUCHER_DATE)='&lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: gray;"&gt;$(vYear)'&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; and MONTH(VOUCHER_DATE)='&lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: gray;"&gt;$(vMonth)'&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 10:14:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063027#M637012</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2016-04-06T10:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Month function in sql query where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063028#M637013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;Hi Heidi,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Change your variable like below,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vMonthStart = Date(Monthstart(today()),'D.M.YYYY h:mm:ss');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vMonthEnd = &lt;SPAN style="font-size: 13.3333px;"&gt;Date(Monthend(today()),'D.M.YYYY &lt;EM style="font-size: 13.3333px;"&gt; h:mm:ss'&lt;/EM&gt;);&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;And SQL statement like below&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM IFSAPP."GEN_LED_VOUCHER_ROW"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;WHERE VOUCHER_DATE&amp;gt; '$(vMonthStart)' and VOUCHER_DATE='$(vMonthEnd)';&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 10:17:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063028#M637013</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2016-04-06T10:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Month function in sql query where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063029#M637014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem is the formats are Different i.e &lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;WHERE YEAR(VOUCHER_DATE)=&lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: gray;"&gt;$(vYear)&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; and &lt;STRONG&gt;NUM(MONTH(VOUCHER_DATE))&lt;/STRONG&gt;=&lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: gray;"&gt;$(vMonth)&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;MONTH() will return a text string and your comparing with the num&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 10:19:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063029#M637014</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2016-04-06T10:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: Month function in sql query where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063030#M637015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or try this where instead of creating variables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;WHERE &lt;SPAN style="color: #000000; font-family: 'Courier New';"&gt;VOUCHER_DATE BETWEEN &lt;SPAN class="pln" style="color: #2e3133;"&gt;trunc &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #2e3133;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #2e3133;"&gt;sysdate&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #2e3133;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #6b291b;"&gt;'mm'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #2e3133;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;CODE class="jive-code" style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN class="kwd" style="color: #00008b; font-size: 12pt;"&gt; AND&lt;/SPAN&gt;&lt;SPAN style="color: #2e3133; font-size: 12pt;"&gt; SYSDATE&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 10:50:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063030#M637015</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2016-04-06T10:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Month function in sql query where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063031#M637016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;FROM IFSAPP."GEN_LED_VOUCHER_ROW"&lt;BR /&gt; WHERE YEAR(VOUCHER_DATE)='&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="color: gray; font-family: 'Courier New'; font-size: 9pt;"&gt;$(vYear)'&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; and MONTH(VOUCHER_DATE)='&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="color: gray; font-family: 'Courier New'; font-size: 9pt;"&gt;$(vMonth)'&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;Before reloading it is better debug your query so that u can know which values are getting populated into &lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="color: gray; font-family: 'Courier New'; font-size: 9pt;"&gt;$(vYear) and &lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="color: gray; font-family: 'Courier New'; font-size: 9pt;"&gt;$(vMonth)&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 11:04:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063031#M637016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-06T11:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Month function in sql query where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063032#M637017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Sorry. I have wrongly mentioned as = instead of &amp;lt;=. Correct statement should be&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-size: 29px; font-family: inherit;"&gt;&lt;EM&gt;FROM IFSAPP."GEN_LED_VOUCHER_ROW"&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-size: 10pt; font-family: inherit;"&gt;&lt;EM&gt;WHERE VOUCHER_DATE&amp;gt;= '$(vMonthStart)' and VOUCHER_DATE&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&amp;lt;=&lt;/STRONG&gt;&lt;/SPAN&gt;'$(vMonthEnd)';&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 12:24:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063032#M637017</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2016-04-06T12:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Month function in sql query where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063033#M637018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all for help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ended up doing a bit like Tamil adviced, using the month start and end dates to limit my data into a spesific month with between function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 17:12:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-function-in-sql-query-where-clause/m-p/1063033#M637018</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-06T17:12:12Z</dc:date>
    </item>
  </channel>
</rss>

