<?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: Working with dates in SAS EG 5.1 in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Working-with-dates-in-SAS-EG-5-1/m-p/261498#M18215</link>
    <description>&lt;P&gt;Check &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p10v3sa3i4kfxfn1sovhi5xzxh8n.htm" target="_self"&gt;INTNX FUNCTION&lt;/A&gt;&amp;nbsp;and &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p1md4mx2crzfaqn14va8kt7qvfhr.htm" target="_self"&gt;INTCK Function&lt;/A&gt;, it should tackle most of your issues.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Apr 2016 19:24:18 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2016-04-05T19:24:18Z</dc:date>
    <item>
      <title>Working with dates in SAS EG 5.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Working-with-dates-in-SAS-EG-5-1/m-p/261492#M18214</link>
      <description>&lt;P&gt;HELP!!! I am having difficulty creating set it and forget it reporting.&amp;nbsp; I have a transaction table that contains posting dates mm/dd/yy.&amp;nbsp; and in comparision with previous day reporting today()-1.&amp;nbsp; I need to continuously be able to pull&amp;nbsp;current month to date, previous month to date, prior year month to date, current quarter to date, prior quarter to date, etc.&amp;nbsp; All of this without having to go into my report daily and hardcode the dates I am looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I have tried thus far, which worked for the month of March, but not since then is&lt;/P&gt;&lt;P&gt;current date =&amp;nbsp;today()-1&amp;nbsp; &amp;nbsp;since our flat files are from yesterday!&amp;nbsp; Then i have this date broken down in to Yr, Qtr, Mon, Day&lt;/P&gt;&lt;P&gt;Prior Month&amp;nbsp;date = today()-31&amp;nbsp; which doesn't necessarily work for the month roll over or for February since its a shorter month&lt;/P&gt;&lt;P&gt;Prior Year Month date&amp;nbsp;= today()-366 for this year only, broken this out in to Yr, Qtr, Mon, Day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then to put beside my transactions&lt;/P&gt;&lt;P&gt;for current day&amp;nbsp; = case when (t1.'CURRENT DATE DAY'n = t1.'POST DATE DAY'n) and&amp;nbsp; (t1.'CD MONTH'n = t1.'POST DATE MONTH'n) and (t1.'CD YEAR'n = t1.'POST DATE YEAR'n) then 'CD' else '' end&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for MTD = CASE WHEN (( t1.'CD YEAR'n =t1.'POST DATE YEAR'n) AND t1.'CD MONTH'n = t1.'POST DATE MONTH'n) THEN 'MTD' ELSE '' END&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for PMTD =CASE WHEN (( t1.'PMTD YEAR'n =t1.'POST DATE YEAR'n) AND ( t1.'PMTD MONTH'n = t1.'POST DATE MONTH'n)) THEN 'PMTD' ELSE '' END&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;etc, etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and it just didn't work.... If anyone has any workable and tested solutions, I would be grateful if you would share.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;El&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 18:40:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Working-with-dates-in-SAS-EG-5-1/m-p/261492#M18214</guid>
      <dc:creator>EIrvin</dc:creator>
      <dc:date>2016-04-05T18:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Working with dates in SAS EG 5.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Working-with-dates-in-SAS-EG-5-1/m-p/261498#M18215</link>
      <description>&lt;P&gt;Check &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p10v3sa3i4kfxfn1sovhi5xzxh8n.htm" target="_self"&gt;INTNX FUNCTION&lt;/A&gt;&amp;nbsp;and &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p1md4mx2crzfaqn14va8kt7qvfhr.htm" target="_self"&gt;INTCK Function&lt;/A&gt;, it should tackle most of your issues.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 19:24:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Working-with-dates-in-SAS-EG-5-1/m-p/261498#M18215</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2016-04-05T19:24:18Z</dc:date>
    </item>
  </channel>
</rss>

