<?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 Weekday() in a SQL Statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Weekday-in-a-SQL-Statement/m-p/818501#M666800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have written this as part of a SQL statement after a preceding load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM table1 RS INNER JOIN table2 PS&lt;/P&gt;&lt;P&gt;ON RS.BUILDING_CODE=PS.BUILDING_CODE where date&amp;gt;=from_date and date&amp;lt;=to_date and&lt;/P&gt;&lt;P&gt;((WeekDay(date)=0 and "day_of_week_1_flag" = 'y') or (WeekDay(date)=1 and "day_of_week_2_flag" = 'y'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting an error that says WeekDay not a recognized built in function.&amp;nbsp; It works in a Load statement, and as a sanity check I checked SQL online; it's a recognized SQL command, as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I doing something wrong?&amp;nbsp; Any insight is appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Dec 2014 20:57:25 GMT</pubDate>
    <dc:creator>raynac</dc:creator>
    <dc:date>2014-12-11T20:57:25Z</dc:date>
    <item>
      <title>Weekday() in a SQL Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Weekday-in-a-SQL-Statement/m-p/818501#M666800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have written this as part of a SQL statement after a preceding load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM table1 RS INNER JOIN table2 PS&lt;/P&gt;&lt;P&gt;ON RS.BUILDING_CODE=PS.BUILDING_CODE where date&amp;gt;=from_date and date&amp;lt;=to_date and&lt;/P&gt;&lt;P&gt;((WeekDay(date)=0 and "day_of_week_1_flag" = 'y') or (WeekDay(date)=1 and "day_of_week_2_flag" = 'y'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting an error that says WeekDay not a recognized built in function.&amp;nbsp; It works in a Load statement, and as a sanity check I checked SQL online; it's a recognized SQL command, as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I doing something wrong?&amp;nbsp; Any insight is appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 20:57:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weekday-in-a-SQL-Statement/m-p/818501#M666800</guid>
      <dc:creator>raynac</dc:creator>
      <dc:date>2014-12-11T20:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Weekday() in a SQL Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Weekday-in-a-SQL-Statement/m-p/818502#M666801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;WeekDay&lt;/STRONG&gt; is a Qlik function, if you want to use weekday use in Qlik section of the load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;weekday&lt;/STRONG&gt;(date),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ......&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;STRONG&gt;weekday&lt;/STRONG&gt;(date) = ... and ...)&amp;nbsp; or (...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;sql select *&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM table1 RS INNER JOIN table2 PS&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ON RS.BUILDING_CODE=PS.BUILDING_CODE where date&amp;gt;=from_date and date&amp;lt;=to_date&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if you have sql server as db, use &lt;STRONG&gt;datepart&lt;/STRONG&gt; in the sql section of the statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load *;&lt;/P&gt;&lt;P&gt;sql select *&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM table1 RS INNER JOIN table2 PS&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ON RS.BUILDING_CODE=PS.BUILDING_CODE where date&amp;gt;=from_date and date&amp;lt;=to_date&lt;/P&gt;&lt;P&gt;and &lt;STRONG&gt;DATEPART&lt;/STRONG&gt; ( dw , date ) = .......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 21:17:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weekday-in-a-SQL-Statement/m-p/818502#M666801</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-12-11T21:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Weekday() in a SQL Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Weekday-in-a-SQL-Statement/m-p/818503#M666802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much!!&amp;nbsp; I got this via email and didn't even read the second half.&amp;nbsp; The first half of your response appears to have gotten the view to do precisely what I wanted it to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 22:45:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weekday-in-a-SQL-Statement/m-p/818503#M666802</guid>
      <dc:creator>raynac</dc:creator>
      <dc:date>2014-12-11T22:45:02Z</dc:date>
    </item>
  </channel>
</rss>

