<?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 How to get current month and last  three months data using pass thru query? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-current-month-and-last-three-months-data-using-pass/m-p/753686#M237588</link>
    <description>&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;connect to oracle as myconn(user=xx pass=xx path=xx);&lt;/P&gt;&lt;P&gt;select * from connection to myconn&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;select * from tranx where datepart(trandate)=intnx('month',trandate,-3)&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;disconnect from myconn;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;Throwing error invalid intnx identifier&lt;/P&gt;&lt;P&gt;Please help me out. Many thanks;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jul 2021 07:28:51 GMT</pubDate>
    <dc:creator>MSK4</dc:creator>
    <dc:date>2021-07-13T07:28:51Z</dc:date>
    <item>
      <title>How to get current month and last  three months data using pass thru query?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-current-month-and-last-three-months-data-using-pass/m-p/753686#M237588</link>
      <description>&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;connect to oracle as myconn(user=xx pass=xx path=xx);&lt;/P&gt;&lt;P&gt;select * from connection to myconn&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;select * from tranx where datepart(trandate)=intnx('month',trandate,-3)&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;disconnect from myconn;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;Throwing error invalid intnx identifier&lt;/P&gt;&lt;P&gt;Please help me out. Many thanks;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 07:28:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-current-month-and-last-three-months-data-using-pass/m-p/753686#M237588</guid>
      <dc:creator>MSK4</dc:creator>
      <dc:date>2021-07-13T07:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current month and last  three months data using pass thru query?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-current-month-and-last-three-months-data-using-pass/m-p/753691#M237591</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Like &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;said&amp;nbsp;&lt;A title="here" href="https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-in-Proc-SQL-gives-error/td-p/472356" target="_self"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-INTNX-in-Proc-SQL-gives-error/td-p/472356&lt;/A&gt;&amp;nbsp;"In an explicit pass-through, you need to use functions that the target database understands. intnx is not a function in Oracle SQL."&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 07:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-current-month-and-last-three-months-data-using-pass/m-p/753691#M237591</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-07-13T07:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current month and last  three months data using pass thru query?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-current-month-and-last-three-months-data-using-pass/m-p/753693#M237593</link>
      <description>&lt;P&gt;When you use explicit pass-through, you must work in the remote environement, which means in your case strict Oracle syntax. Neither the DATEPART nor the INTNX function are available in Oracle, so you need to use the respective Oracle functions for that. Datetime to date will probably be a cast. Also keep in mind that databases use a different system of literals for dates etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you need to review your logic. This condition will never be true during the existence of the universe:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;datepart(trandate)=intnx('month',trandate,-3)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A date can never be equal to the same date minus three months, and if you need to use DATEPART because trandate is a datetime, then you need to use it in other places also.&lt;/P&gt;
&lt;P&gt;The INTNX function does also allow datetime related intervals, like dtmonth, which would allow you to use the datetime directly, but ONLY IN SAS!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest that you test your query first in the native Oracle client, and once it works there, see how you can send it from SAS.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 07:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-current-month-and-last-three-months-data-using-pass/m-p/753693#M237593</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-13T07:38:15Z</dc:date>
    </item>
  </channel>
</rss>

