<?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: PROC SQL with HAVING MAX not returning newest record. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-with-HAVING-MAX-not-returning-newest-record/m-p/492978#M129663</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;&lt;BR /&gt;having Createdate=max(Createdate)&lt;BR /&gt;&lt;BR /&gt;instead</description>
    <pubDate>Thu, 06 Sep 2018 12:16:07 GMT</pubDate>
    <dc:creator>gamotte</dc:creator>
    <dc:date>2018-09-06T12:16:07Z</dc:date>
    <item>
      <title>PROC SQL with HAVING MAX not returning newest record.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-with-HAVING-MAX-not-returning-newest-record/m-p/492973#M129661</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have wrote some code that should pick up newest date in from a variable but it seems to not work. There are no errors or warning in the log but we do see the "NOTE: The query requires remerging summary statistics back with the original data".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not entirely sure where about it is&amp;nbsp;breaking down&amp;nbsp;as a number of other solutions in the forum mention using the MAX to create a table with just the newest records and also use HAVING instead of SELECT for summary functions. My end goal is to have a report&amp;nbsp;from the data which shows&amp;nbsp;each&amp;nbsp;unique&amp;nbsp;Pzinskey for each case but only the most up to date record.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sandy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;

create table pipeline_base as

select t1.* from HLMI_SS.MAP_FLA_05SEP18 as t1

where datepart(createdate) ge today()-180 and propertyname eq "ProcessStatus"

group by Pzinskey

having max(Createdate)

order by Pzinskey, Createdate desc;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 12:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-with-HAVING-MAX-not-returning-newest-record/m-p/492973#M129661</guid>
      <dc:creator>Sanflo</dc:creator>
      <dc:date>2018-09-06T12:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL with HAVING MAX not returning newest record.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-with-HAVING-MAX-not-returning-newest-record/m-p/492978#M129663</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;&lt;BR /&gt;having Createdate=max(Createdate)&lt;BR /&gt;&lt;BR /&gt;instead</description>
      <pubDate>Thu, 06 Sep 2018 12:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-with-HAVING-MAX-not-returning-newest-record/m-p/492978#M129663</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2018-09-06T12:16:07Z</dc:date>
    </item>
  </channel>
</rss>

