<?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: Rolling dates using intnx in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Rolling-dates-using-intnx/m-p/872424#M344687</link>
    <description>&lt;P&gt;My guess is CAMPAIGN_DATE is a DATETIME and not a DATE variable. Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data newdata;
set libnamexyz.olddata (where = ( CAMPAIGN_DATE between intnx('dtday',DATETIME(),-90) and DATETIME()));
format cust_id 20.;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Apr 2023 00:57:36 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2023-04-27T00:57:36Z</dc:date>
    <item>
      <title>Rolling dates using intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-dates-using-intnx/m-p/872419#M344682</link>
      <description>&lt;P&gt;I'm trying to extract some data for the last 3 months on a rolling basis, which means that whenever the script is run, it would pull data for last 3 months based on the current month. I have two date columns, namely, campaign_date and year_month whose values are in the format of '&lt;SPAN&gt;03APR2023:00:00:00' and '2304' respectively and I'm using the column campaign_date for extracting the data, but the below script does not return any value. Can someone please review the code and let me know the modification required?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data newdata;&lt;BR /&gt;set libnamexyz.olddata (where=( CAMPAIGN_DATE between DATE() AND intnx('dtday',DATE(),-90)));&lt;BR /&gt;format cust_id 20.;&lt;BR /&gt;Run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 00:08:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-dates-using-intnx/m-p/872419#M344682</guid>
      <dc:creator>hk24</dc:creator>
      <dc:date>2023-04-27T00:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling dates using intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-dates-using-intnx/m-p/872424#M344687</link>
      <description>&lt;P&gt;My guess is CAMPAIGN_DATE is a DATETIME and not a DATE variable. Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data newdata;
set libnamexyz.olddata (where = ( CAMPAIGN_DATE between intnx('dtday',DATETIME(),-90) and DATETIME()));
format cust_id 20.;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Apr 2023 00:57:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-dates-using-intnx/m-p/872424#M344687</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-04-27T00:57:36Z</dc:date>
    </item>
  </channel>
</rss>

