<?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: Problem with SQL and date format in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-SQL-and-date-format/m-p/1033126#M637748</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's great, works a treat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so basically transpose the date at the top, but the vital thing I had missed was the single speech marks around $(VToday)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Apr 2016 08:20:00 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-04-28T08:20:00Z</dc:date>
    <item>
      <title>Problem with SQL and date format</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-SQL-and-date-format/m-p/1033123#M637745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the attached QVW I'm trying to extract data in the Orderbook tab where the snapshot_date is within the last 365 days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a variable vToday which is currently set on 90 to test but it still extracts data back to 23/06/2015&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even when I hard code the extract to extract where snapshot_date &amp;gt; '01/10/2015' is still pulls from 23/06/2015&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only was I can get this to work is to hard code with 10/01/2015, i.e. transposing the month and day so using MM/DD/YYYY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the data coming out of SQL server is in DD/MM/YY format so I don't understand why this is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2016 16:16:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-SQL-and-date-format/m-p/1033123#M637745</guid>
      <dc:creator />
      <dc:date>2016-04-27T16:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SQL and date format</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-SQL-and-date-format/m-p/1033124#M637746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you try reloading with this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG style="text-decoration: line-through;"&gt;LET vToday = Date(floor(Today())-90,'DD-MMM-YYYY');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;date(floor(snapshot_date), 'DD/MM/YYYY') as snapshot_date,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;warehouse as orderbook_warehouse,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;HPC_due_date as orderbook_due_date,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;required_date as orderbook_required_date,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;customer as orderbook_customer,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;product as orderbook_product,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;order_qty as orderbook_qty,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;order_book_value as orderbook_value,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;snapshot_date as orderbook_snapshot_date,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;IF(HPC_due_date &amp;lt;= snapshot_date,'Y','N') as orderbook_arrears;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;ODBC CONNECT TO [Sage PE Live];&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;SQL SELECT *&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;FROM pelive.dbo."hpc_op_orderbook_history"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;where HPC_due_date &amp;lt; snapshot_date+90&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: line-through;"&gt;and snapshot_date &amp;gt; '$(vToday)';&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2016 16:35:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-SQL-and-date-format/m-p/1033124#M637746</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-27T16:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SQL and date format</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-SQL-and-date-format/m-p/1033125#M637747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;May bad, try this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;LET vToday = Date(floor(Today())-90,'MM/DD/YYYY');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;date(floor(snapshot_date), 'DD/MM/YYYY') as snapshot_date,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;warehouse as orderbook_warehouse,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;HPC_due_date as orderbook_due_date,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;required_date as orderbook_required_date,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;customer as orderbook_customer,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;product as orderbook_product,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;order_qty as orderbook_qty,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;order_book_value as orderbook_value,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;snapshot_date as orderbook_snapshot_date,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;IF(HPC_due_date &amp;lt;= snapshot_date,'Y','N') as orderbook_arrears;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;ODBC CONNECT TO [Sage PE Live];&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;SQL SELECT *&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;FROM pelive.dbo."hpc_op_orderbook_history"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG&gt;where HPC_due_date &amp;lt; snapshot_date+90&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG style="color: #575757;"&gt;and snapshot_date &amp;gt; &lt;SPAN style="color: #ff0000; font-size: 14pt;"&gt;'&lt;/SPAN&gt;$(vToday)&lt;SPAN style="color: #ff0000; font-size: 14pt;"&gt;'&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2016 16:39:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-SQL-and-date-format/m-p/1033125#M637747</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-27T16:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SQL and date format</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-SQL-and-date-format/m-p/1033126#M637748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's great, works a treat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so basically transpose the date at the top, but the vital thing I had missed was the single speech marks around $(VToday)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2016 08:20:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-SQL-and-date-format/m-p/1033126#M637748</guid>
      <dc:creator />
      <dc:date>2016-04-28T08:20:00Z</dc:date>
    </item>
  </channel>
</rss>

