<?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: SAS to SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/313797#M68235</link>
    <description>You can also use BETWEEN with a WHERE. Does your SQL server support BETWEEN?&lt;BR /&gt;where datepart(xyz) between datepart(abc) and datepart(abc) + 7;&lt;BR /&gt;&lt;BR /&gt;The DATEPART function is a SAS-specific function. So it will work in SAS Proc SQL. I do not know whether it will work in SQL server. &lt;BR /&gt;&lt;BR /&gt;cynthia</description>
    <pubDate>Wed, 23 Nov 2016 14:37:01 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2016-11-23T14:37:01Z</dc:date>
    <item>
      <title>SAS to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/313791#M68231</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help in the following SAS command to get it translated into SQL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if datepart(abc) &amp;lt;= datepart(xyz) &amp;lt;= datepart(abc)+7 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 14:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/313791#M68231</guid>
      <dc:creator>VinayakKankate</dc:creator>
      <dc:date>2016-11-23T14:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/313792#M68232</link>
      <description>&lt;P&gt;The datepart function can also be used in PROC SQL.&lt;/P&gt;
&lt;P&gt;If&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if datepart(abc) &amp;lt;= datepart(xyz) &amp;lt;= datepart(abc)+7;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;appears as a standalone statement (without a then ....) in a data step, it is called a subsetting if, and can be done in SQL in a where condition. If abc or xyz are variables that are newly created in the SQL, use the "calculated" keyword.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 14:25:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/313792#M68232</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-23T14:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/313794#M68233</link>
      <description>&lt;P&gt;Hey&amp;nbsp;KurtBremser,&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;Thanks for your instant reply,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;we need this to be converted into SQL server.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 14:28:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/313794#M68233</guid>
      <dc:creator>VinayakKankate</dc:creator>
      <dc:date>2016-11-23T14:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/313797#M68235</link>
      <description>You can also use BETWEEN with a WHERE. Does your SQL server support BETWEEN?&lt;BR /&gt;where datepart(xyz) between datepart(abc) and datepart(abc) + 7;&lt;BR /&gt;&lt;BR /&gt;The DATEPART function is a SAS-specific function. So it will work in SAS Proc SQL. I do not know whether it will work in SQL server. &lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Wed, 23 Nov 2016 14:37:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/313797#M68235</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-11-23T14:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/313799#M68237</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/116330"&gt;@VinayakKankate&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hey&amp;nbsp;KurtBremser,&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;Thanks for your instant reply,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;we need this to be converted into SQL server.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then you will have to look for functional equivalents of the datepart() function in the MS SQL Server documentation.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 14:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-to-SQL/m-p/313799#M68237</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-23T14:48:58Z</dc:date>
    </item>
  </channel>
</rss>

