<?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: Converting a date to number in SQL in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Converting-a-date-to-number-in-SQL/m-p/611181#M1101905</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #0000ff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;SQL&lt;/STRONG&gt;&lt;/SPAN&gt; SELECT&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;Call_Num,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;Call_InDate, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;CONVERT&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;bigint&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;CONVERT&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;(Call_InDate&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Format'&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;))&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS&amp;nbsp; Call_InDateNum,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;etc&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;FROM MERRYCHEFSC5LIVE.dbo.SCCall&lt;BR /&gt;where Call_Num &amp;gt;=&amp;nbsp; 100000&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Apr 2014 15:38:01 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-04-07T15:38:01Z</dc:date>
    <item>
      <title>Converting a date to number in SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-a-date-to-number-in-SQL/m-p/611180#M1101904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="; color: #0000ff; font-size: 12pt;"&gt;&lt;STRONG&gt;Is it possible to convert a date in SQL to a number&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;&lt;STRONG&gt;At present I'm doing this&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; text-decoration: underline;"&gt;INITIAL LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;ODBC&lt;/SPAN&gt; &lt;SPAN style="; color: #0000ff;"&gt;&lt;STRONG&gt;CONNECT&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;TO&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;[SC5 LIVE]&lt;/SPAN&gt;;&lt;BR /&gt;SCCallTess:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="; color: #0000ff;"&gt;&lt;STRONG&gt;SQL&lt;/STRONG&gt;&lt;/SPAN&gt; SELECT &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Call_Num,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Call_InDate etc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;FROM&amp;nbsp; SC5LIVE.dbo.SCCall&lt;BR /&gt;where Call_Num &amp;gt;=&amp;nbsp; 100000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; text-decoration: underline;"&gt;&lt;STRONG&gt;THEN &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 12pt;"&gt;load ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Call_Num,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Call_InDate&amp;nbsp; etc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt; &lt;SPAN style="color: #0000ff;"&gt;Resident&lt;/SPAN&gt; SCCallTess&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;where &lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;num&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Call_InDate&lt;/SPAN&gt;) &amp;gt;40179 ;&amp;nbsp; //DATE 1/1/2010&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;drop table SCCallTess;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 12pt;"&gt;This works&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 12pt;"&gt;But I would like to do the where with the SQL load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 12pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 12pt;"&gt;Is this possible. Num is not recognised in a SQL load&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 15:32:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-a-date-to-number-in-SQL/m-p/611180#M1101904</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2014-04-07T15:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a date to number in SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-a-date-to-number-in-SQL/m-p/611181#M1101905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #0000ff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;SQL&lt;/STRONG&gt;&lt;/SPAN&gt; SELECT&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;Call_Num,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;Call_InDate, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;CONVERT&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;bigint&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;CONVERT&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;(Call_InDate&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Format'&lt;/SPAN&gt;&lt;SPAN class="pun" style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;))&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS&amp;nbsp; Call_InDateNum,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;etc&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;FROM MERRYCHEFSC5LIVE.dbo.SCCall&lt;BR /&gt;where Call_Num &amp;gt;=&amp;nbsp; 100000&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 15:38:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-a-date-to-number-in-SQL/m-p/611181#M1101905</guid>
      <dc:creator />
      <dc:date>2014-04-07T15:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a date to number in SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-a-date-to-number-in-SQL/m-p/611182#M1101906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this works for my sql server database&lt;/P&gt;&lt;P&gt;I think you can adapt to your table and field names&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vStartDate =date(40179, 'DD/MM/YYYY');&lt;/P&gt;&lt;P&gt;trace $(vStartDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table3:&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;[dat_data]&lt;/P&gt;&lt;P&gt;FROM [d003_date]&lt;/P&gt;&lt;P&gt;where dat_data &amp;gt; convert(datetime,'$(vStartDate)',103)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 15:53:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-a-date-to-number-in-SQL/m-p/611182#M1101906</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-04-07T15:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a date to number in SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-a-date-to-number-in-SQL/m-p/611183#M1101907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A preload should also work instead of using two tables:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;ODBC CONNECT TO [SC5 LIVE];&lt;/P&gt;
&lt;P&gt;SCCallTess:&lt;/P&gt;
&lt;P&gt;LOAD Call_Num,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call_InDate&amp;nbsp; etc&lt;/P&gt;
&lt;P&gt;where num(Call_InDate)&amp;gt;40179;&lt;/P&gt;
&lt;P&gt;SQL SELECT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call_Num,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call_InDate etc&lt;/P&gt;
&lt;P&gt;FROM&amp;nbsp; SC5LIVE.dbo.SCCall&lt;/P&gt;
&lt;P&gt;where Call_Num &amp;gt;= 100000;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 16:00:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-a-date-to-number-in-SQL/m-p/611183#M1101907</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-04-07T16:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a date to number in SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-a-date-to-number-in-SQL/m-p/611184#M1101908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nicole and Sri. Thanks for your replies. I will check your solutions tomorrow&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 16:53:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-a-date-to-number-in-SQL/m-p/611184#M1101908</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2014-04-07T16:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a date to number in SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-a-date-to-number-in-SQL/m-p/611185#M1101909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/02/19/why-don-t-my-dates-work#comment-15729"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/02/19/why-don-t-my-dates-work#comment-15729&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is also very helpful. To ensure date is a value not text. Then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vDateFrom = Num ('01/01/2010') //or could include the appropriate number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then&lt;/P&gt;&lt;P&gt;where Call_InDate &amp;gt;= $(vDateFrom);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should work without converting the date to a number (I will test at work tomorrow)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT This worked. And was the approach I used. I wanted to convert the Call_InDate to a number but this was not necessary with this approach&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 16:02:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-a-date-to-number-in-SQL/m-p/611185#M1101909</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2014-04-08T16:02:27Z</dc:date>
    </item>
  </channel>
</rss>

