<?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: FedSQL and Passing Dates in Filter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629301#M186076</link>
    <description>With your date in that format? Can you post the code/log?</description>
    <pubDate>Tue, 03 Mar 2020 22:03:24 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-03-03T22:03:24Z</dc:date>
    <item>
      <title>FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629289#M186067</link>
      <description>&lt;P&gt;I am working with SAS Viya.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code&lt;/P&gt;&lt;P&gt;cas;&lt;BR /&gt;caslib _all_ Assign;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;proc fedsql sessref=casauto;&lt;BR /&gt;create table PN_Transit as&lt;BR /&gt;(select distinct Port1 from LM.TRANS&lt;BR /&gt;where MasterClientName = 'D'&lt;BR /&gt;and datepart(EffectiveDate) ='01MAY2019');&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LM.TRANS is a table in SQL that is connected. This query works just fine if I do not have the date filter. It works for any other filter that I want to have except the date one. So I am not sure if this is the right syntax. This does create a table called PN_Transit like I wanted it to but i returns 0 observations. I tried several combinations in the date filter but in vain. In the SQL table, the effective date is actually stored as "2019-05-01 00:00:00.000". How do I get this working?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 21:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629289#M186067</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2020-03-03T21:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629293#M186070</link>
      <description>&lt;P&gt;I got it by doing&amp;nbsp;and put(datepart(Effectivedate), date9.)='01MAY2019')&lt;/P&gt;&lt;P&gt;Worked just fine.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 21:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629293#M186070</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2020-03-03T21:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629296#M186072</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;datepart(effectiveDate) = '01May2019'd&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The above should work as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/276974"&gt;@Santha&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I got it by doing&amp;nbsp;and put(datepart(Effectivedate), date9.)='01MAY2019')&lt;/P&gt;
&lt;P&gt;Worked just fine.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 21:54:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629296#M186072</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-03T21:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629297#M186073</link>
      <description>&lt;P&gt;&lt;SPAN&gt;You need to tell SAS this is a date. Add D after the string:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt; datepart(EffectiveDate) = '01MAY2019'd&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Other letters can be added like&amp;nbsp;T for time, DT for datetime, X for hexadecimal, N for name, B for binary.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 21:54:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629297#M186073</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-03-03T21:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629299#M186074</link>
      <description>&lt;P&gt;I tried adding "d" after the string. It does not like it. It says "syntax error" near "D"&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 22:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629299#M186074</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2020-03-03T22:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629301#M186076</link>
      <description>With your date in that format? Can you post the code/log?</description>
      <pubDate>Tue, 03 Mar 2020 22:03:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629301#M186076</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-03T22:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629304#M186078</link>
      <description>&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;75&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;76 proc fedsql sessref=casauto;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;77 create table PN_Transit as&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;78 (select distinct Port1 from LM.TRANS&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;79 where MasterClientName = 'D'&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;80 and datepart(EffectiveDate) ='01MAY2019'd);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;ERROR: Syntax error at or near "D"&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;ERROR: The action stopped due to errors.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: The FedSQL action was not successful.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROC FEDSQL has set option NOEXEC and will continue to prepare statements.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;81 quit;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE FEDSQL used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;82&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;83 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;</description>
      <pubDate>Tue, 03 Mar 2020 22:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629304#M186078</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2020-03-03T22:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629305#M186079</link>
      <description>&lt;P&gt;Not using a function would speed up your query. Like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;where effectiveDate = "01may2019:00:00:00"dt&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 22:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629305#M186079</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-03-03T22:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629306#M186080</link>
      <description>&lt;P&gt;The syntax is different for fedSQL. Sorry about the confusion.&lt;/P&gt;
&lt;P&gt;See here:&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=fedsqlref&amp;amp;docsetTarget=n0250hv7mns19hn18gi0clo71j7e.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=fedsqlref&amp;amp;docsetTarget=n0250hv7mns19hn18gi0clo71j7e.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 22:12:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629306#M186080</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-03-03T22:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629307#M186081</link>
      <description>&lt;P&gt;Still compare to a datetime though, rather than converting to a date.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 22:13:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/629307#M186081</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-03-03T22:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/729407#M226970</link>
      <description>&lt;P&gt;Why is this so well hidden? Really hard for current SAS programmers when there is a syntax change like this.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 15:03:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/729407#M226970</guid>
      <dc:creator>PaalNavestad</dc:creator>
      <dc:date>2021-03-26T15:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/729409#M226972</link>
      <description>How is something that has it's own chapter in the documentation "hidden"?&lt;BR /&gt;&lt;BR /&gt;FEDSQL is essentially another language entirely, like HASH table coding for example.&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Mar 2021 15:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/729409#M226972</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-26T15:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/781206#M248985</link>
      <description>Hi the documentation explain the way dates and time is handled. I had a challenge understanding this.&lt;BR /&gt;The way to use a date in a where clause is&lt;BR /&gt;&lt;BR /&gt;where dateVariable &amp;gt;= date'2015-01-01'&lt;BR /&gt;a bit confusing as you tell what it is in front and that there are no () before the date constant.&lt;BR /&gt;Fortunatly the date() function worked well in subsets.</description>
      <pubDate>Fri, 19 Nov 2021 09:34:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/781206#M248985</guid>
      <dc:creator>PaalNavestad</dc:creator>
      <dc:date>2021-11-19T09:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: FedSQL and Passing Dates in Filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/781229#M248995</link>
      <description>&lt;P&gt;Hidden is mainly the wrong word. The challenge is that it is rather different from the SQL procedure so an article, or change type log would have been good.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 11:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FedSQL-and-Passing-Dates-in-Filter/m-p/781229#M248995</guid>
      <dc:creator>PaalNavestad</dc:creator>
      <dc:date>2021-11-19T11:54:42Z</dc:date>
    </item>
  </channel>
</rss>

