<?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: Select records with most recent date for groups of points in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443499#M34741</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use the &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/dissolve.htm"&gt;dissolve&lt;/A&gt; geoprocessing tool with &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Point&lt;/SPAN&gt; as the dissolve field and and specify &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Date&lt;/SPAN&gt; as the statistics field with the MAX statistic type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;Since you just want a flat file, you can save the dissolve &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/modelbuilder/the-in-memory-workspace.htm"&gt;output to memory&lt;/A&gt;, &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/make-table-view.htm"&gt;make a table view&lt;/A&gt;,&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/conversion-toolbox/table-to-excel.htm"&gt;export it to Excel&lt;/A&gt;, then &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/delete.htm#C_GUID-DCC1C258-981A-4703-BE88-895A78735083"&gt;clean up the mess&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 May 2017 22:32:33 GMT</pubDate>
    <dc:creator>BlakeTerhune</dc:creator>
    <dc:date>2017-05-12T22:32:33Z</dc:date>
    <item>
      <title>Select records with most recent date for groups of points</title>
      <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443498#M34740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with a feature class (sample_Locations) in an ArcSDE Geodatabase and my table has a "Point" field and a "Date" field, the field types are string and date, respectively. &amp;nbsp;There are over 2000 features in the table and the point ID's are not unique, there are only ~100 point ID's, so there may be many points with the same Point ID. &amp;nbsp;I am trying to select records from the table with the most recent date for sets of values, where the field "Point" is the field that contains the values that define groups.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/350968_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried using the following subquery, but it did not select the correct records. &amp;nbsp;It selected a very random assortment of features.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f5f5f5; font-weight: 300;"&gt;[Date] in (SELECT max( [Date] ) FROM Sample_Locations&amp;nbsp;GROUP BY [Point])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone provide help for performing this selection using a&amp;nbsp;Python script? &amp;nbsp;Ideally, I would like to select the features and export these selected features to a&amp;nbsp;standalone excel table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 May 2017 21:49:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443498#M34740</guid>
      <dc:creator>JasonFultz</dc:creator>
      <dc:date>2017-05-12T21:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with most recent date for groups of points</title>
      <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443499#M34741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use the &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/dissolve.htm"&gt;dissolve&lt;/A&gt; geoprocessing tool with &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Point&lt;/SPAN&gt; as the dissolve field and and specify &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Date&lt;/SPAN&gt; as the statistics field with the MAX statistic type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;Since you just want a flat file, you can save the dissolve &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/modelbuilder/the-in-memory-workspace.htm"&gt;output to memory&lt;/A&gt;, &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/make-table-view.htm"&gt;make a table view&lt;/A&gt;,&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/conversion-toolbox/table-to-excel.htm"&gt;export it to Excel&lt;/A&gt;, then &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/delete.htm#C_GUID-DCC1C258-981A-4703-BE88-895A78735083"&gt;clean up the mess&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 May 2017 22:32:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443499#M34741</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2017-05-12T22:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with most recent date for groups of points</title>
      <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443500#M34742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you are using an enterprise geodatabase, it is fairly straightforward using SQL NOT EXISTS.&amp;nbsp; See &lt;A href="https://community.esri.com/thread/169714"&gt;https://community.esri.com/thread/169714&lt;/A&gt; for example code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 May 2017 02:19:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443500#M34742</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-05-13T02:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with most recent date for groups of points</title>
      <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443501#M34743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Replace &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;fc&lt;/SPAN&gt; in the following with the actual name of the table:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;qry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NOT EXISTS (SELECT 1 FROM fc f WHERE fc.point = f.point AND f.date &amp;gt; fc.date)"&lt;/SPAN&gt;&amp;nbsp; 
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByAttribute_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; qry&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given that "Date" can be both a data type and function depending on the languages involved, I strongly discourage the use of it as a field name.&amp;nbsp; If you haven't run into issues already, I expect you eventually will run into some.&amp;nbsp; Also, "Point" is typically thought of in a spatial sense in GIS systems.&amp;nbsp; Having a text field named Point and storing non-spatial values in it, might create some confusion or usability issues down the road.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:50:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443501#M34743</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T19:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with most recent date for groups of points</title>
      <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443502#M34744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is using Python an option or does it have to be SQL-based?&amp;nbsp; There are Python-based solutions to this question as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 May 2017 14:48:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443502#M34744</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-05-13T14:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with most recent date for groups of points</title>
      <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443503#M34745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joshua, &amp;nbsp;Thank you for the reply. &amp;nbsp;I would actually prefer to use a Python script as opposed to an SQL query, if possible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will give the SQL query a try and let you know the result, as I am away from the data at the moment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2017 02:50:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443503#M34745</guid>
      <dc:creator>JasonFultz</dc:creator>
      <dc:date>2017-05-18T02:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with most recent date for groups of points</title>
      <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443504#M34746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are several ways to go about this using Python, some are straight Python and others mix Python with some basic SQL for sorting the data set first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One Python approach that avoids sorting the data first relies on using dictionaries to store and compare values:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;lyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# A layer or tableview object, usually retrieved using listing methods&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# in arcpy.mapping&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; collections &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; defaultdict&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; namedtuple

defaultdate &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; datetime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;datetime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
record &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; namedtuple&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"record"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"oid date"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
max_date &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; defaultdict&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;lambda&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; record&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; defaultdate&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"OID@"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Point"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Date"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cur&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; oid&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; point&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; date &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cur&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; max_date&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;point&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;date &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;date &lt;SPAN class="operator token"&gt;or&lt;/SPAN&gt; defaultdate&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max_date&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;point&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; record&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;oid&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; date&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
oids &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;rec&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;oid &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; rec &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; max_date&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;values&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; rec&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;oid&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;setSelectionSet&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"NEW"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; oids&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.python.org/2/library/collections.html#collections.defaultdict" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;defaultdicts&lt;/SPAN&gt; &lt;/A&gt;are handy and make writing and reading code much easier in certain situations, like this one.&amp;nbsp; I find &lt;A href="https://docs.python.org/2/library/collections.html#collections.namedtuple" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;namedtuples&lt;/SPAN&gt; &lt;/A&gt;are handy as well, and they make working with the code much easier.&amp;nbsp; For example, I find &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;max_date[point].date&lt;/SPAN&gt; much clearer than &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;max_date[point][1]&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although your data appears to have date values for every record, the code above was written to handle records not having date values.&amp;nbsp; Unless you know the date field in the data set doesn't allow NULL, it is good to have your code accommodate the possibility in case one does show up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I find some time, I will show an example using straight Python that involves sorting the data set first.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:50:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443504#M34746</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T19:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with most recent date for groups of points</title>
      <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443505#M34747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mr. Bixby,&lt;/P&gt;&lt;P&gt;Maybe you can contribute to a thread I am involved in with &lt;A _jive_internal="true" href="https://community.esri.com/message/772784-re-collector-use-related-layer-to-symbolise-feature?commentID=772784#comment-772811" title="Go to message"&gt;&lt;SPAN style="color: #0066cc; text-decoration: underline;"&gt;Jerry Corum&lt;/SPAN&gt;&lt;/A&gt; &lt;SMALL&gt;&lt;SPAN style="font-size: small;"&gt;on&lt;/SPAN&gt;&lt;/SMALL&gt; &lt;A _jive_internal="true" href="https://community.esri.com/message/772784-re-collector-use-related-layer-to-symbolise-feature?commentID=772784#comment-772784"&gt;&lt;SPAN style="color: #0066cc; text-decoration: underline;"&gt;May 17, 2018 12:11 PM&lt;/SPAN&gt;&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/message/772784-re-collector-use-related-layer-to-symbolise-feature?commentID=772784#comment-772784"&gt;https://community.esri.com/message/772784-re-collector-use-related-layer-to-symbolise-feature?commentID=772784#comment-772784&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I think we are trying to use a SQL query with no python.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 20:08:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443505#M34747</guid>
      <dc:creator>AndresCastillo</dc:creator>
      <dc:date>2018-05-17T20:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with most recent date for groups of points</title>
      <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443506#M34748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andres, I took a look at the thread you referenced, and I think it might be best to start a new, clean thread.&amp;nbsp; The thread is from 2015 and has comments spanning all years since.&amp;nbsp; Unless I am misreading comments, the thread seem to wonder in terms of topic, which is why I wonder if starting a new thread and asking your question might be easier for people to response to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 20:21:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443506#M34748</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-05-17T20:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with most recent date for groups of points</title>
      <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443507#M34749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;I started a new question here:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/message/773010-symbolizing-feature-class-using-related-table-values"&gt;https://community.esri.com/message/773010-symbolizing-feature-class-using-related-table-values&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2018 14:00:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443507#M34749</guid>
      <dc:creator>AndresCastillo</dc:creator>
      <dc:date>2018-05-18T14:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with most recent date for groups of points</title>
      <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443508#M34750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just wanted to follow up on this because I needed to do this and the above sql failed for me.&amp;nbsp; So in case anyone out there is looking for a SQL solution&amp;nbsp;contained in&amp;nbsp;a def query, I re-wrote the query to something that worked (for me), remembering this will only work forfeature classes stored in a&amp;nbsp; SDE,&amp;nbsp;not a file geodatabase&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;replace:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;featureclass&amp;nbsp; &lt;EM style="color: #000000;"&gt;the name of your feature class&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Point &lt;EM style="color: #000000;"&gt;The name field for your feature class, in the original question called "Point"&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;DATE &lt;SPAN style="color: #000000;"&gt;&lt;EM&gt;The date field of your feature class you are trying to get the latest date of&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJECTID IN (SELECT OBJECTID FROM &lt;SPAN style="color: #ff0000;"&gt;featureclass&lt;/SPAN&gt; a JOIN (SELECT &lt;SPAN style="color: #ff0000;"&gt;Point&lt;/SPAN&gt;, MAX (&lt;SPAN style="color: #ff0000;"&gt;date&lt;/SPAN&gt;) DATE FROM &lt;SPAN style="color: #ff0000;"&gt;featureclass&lt;/SPAN&gt; GROUP BY &lt;SPAN style="color: #ff0000;"&gt;Point&lt;/SPAN&gt;) b ON a.&lt;SPAN style="color: #ff0000;"&gt;Point&lt;/SPAN&gt; = b.&lt;SPAN style="color: #ff0000;"&gt;Point&lt;/SPAN&gt; AND a.&lt;SPAN style="color: #ff0000;"&gt;DATE&lt;/SPAN&gt; = b.&lt;SPAN style="color: #ff0000;"&gt;DATE&lt;/SPAN&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2018 20:14:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/443508#M34750</guid>
      <dc:creator>NicholasReseburg1</dc:creator>
      <dc:date>2018-10-31T20:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with most recent date for groups of points</title>
      <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/1214693#M65652</link>
      <description>&lt;P&gt;I had issues making this work as displayed above and would suggest the following changes just to make a bit more clear regarding what is a field in feature class vs what is a text from the query. Great solution though and thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;OBJECTID IN (SELECT OBJECTID FROM &lt;FONT color="#FF0000"&gt;featureclass&amp;nbsp;&lt;/FONT&gt;a JOIN (SELECT &lt;FONT color="#FF0000"&gt;point&lt;/FONT&gt;, MAX(&lt;FONT color="#FF0000"&gt;datefield&lt;/FONT&gt;) as 'DateField' FROM&amp;nbsp;&lt;FONT color="#FF0000"&gt;featureclass&amp;nbsp;&lt;/FONT&gt;GROUP BY &lt;FONT color="#FF0000"&gt;point&lt;/FONT&gt;)b on a.&lt;FONT color="#FF0000"&gt;point&lt;/FONT&gt; = b.&lt;FONT color="#FF0000"&gt;point&lt;/FONT&gt; AND a.&lt;FONT color="#FF0000"&gt;datefield&amp;nbsp;&lt;/FONT&gt;= b.DateField)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and since MAX ignores Null values I also tagged on a "AND &lt;FONT color="#FF0000"&gt;datefield&lt;/FONT&gt; IS NOT NULL" to the end&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 16:37:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/1214693#M65652</guid>
      <dc:creator>Jol1234</dc:creator>
      <dc:date>2022-09-21T16:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with most recent date for groups of points</title>
      <link>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/1273957#M67318</link>
      <description>&lt;P&gt;Thanks! This helped immensely. Below is the code that worked for me.&lt;/P&gt;&lt;P&gt;feature class: &lt;FONT color="#FF0000"&gt;WaterQuality &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;point field: &lt;FONT color="#FF0000"&gt;StationID&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Date field: &lt;FONT color="#FF0000"&gt;SampleDate&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;OBJECTID IN (SELECT OBJECTID FROM &lt;FONT color="#FF0000"&gt;WaterQuality&lt;/FONT&gt; a JOIN (SELECT &lt;FONT color="#FF0000"&gt;StationID&lt;/FONT&gt;, MAX(&lt;FONT color="#FF0000"&gt;SampleDate&lt;/FONT&gt;) DATE FROM &lt;FONT color="#FF0000"&gt;WaterQuality&lt;/FONT&gt; GROUP BY &lt;FONT color="#FF0000"&gt;StationID&lt;/FONT&gt;) b ON a.&lt;FONT color="#FF0000"&gt;StationID&lt;/FONT&gt; = b.&lt;FONT color="#FF0000"&gt;StationID&lt;/FONT&gt; AND a.&lt;FONT color="#FF0000"&gt;SampleDate&lt;/FONT&gt; = b.DATE&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 04:26:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-records-with-most-recent-date-for-groups-of/m-p/1273957#M67318</guid>
      <dc:creator>DaleSmith</dc:creator>
      <dc:date>2023-03-31T04:26:26Z</dc:date>
    </item>
  </channel>
</rss>

