<?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 Make feature layer based off last edited date in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/make-feature-layer-based-off-last-edited-date/m-p/384316#M30277</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have editor tracking enabled on a feature class, and need to calculate some fields within a polygon that are edited each day. I currently have a script that will calculate the fields for all of the features within the polygon, but there are thousands of features and I only need to calculate the ones that were edited each day. My issue is creating a feature layer with a where clause for only today's features. What's strange is that it will work using the python window within ArcMap, but won't work as a standalone script. The layer created just contains all of the features...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.MakeFeatureLayer_management(meters, 'meter_layer', "'last_edited_date' &amp;gt;= 'DATEADD(d, 0, DATEDIFF(d, 0, GETDATE()))'", "", "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Jun 2019 20:38:47 GMT</pubDate>
    <dc:creator>TraceStanford1</dc:creator>
    <dc:date>2019-06-24T20:38:47Z</dc:date>
    <item>
      <title>Make feature layer based off last edited date</title>
      <link>https://community.esri.com/t5/python-questions/make-feature-layer-based-off-last-edited-date/m-p/384316#M30277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have editor tracking enabled on a feature class, and need to calculate some fields within a polygon that are edited each day. I currently have a script that will calculate the fields for all of the features within the polygon, but there are thousands of features and I only need to calculate the ones that were edited each day. My issue is creating a feature layer with a where clause for only today's features. What's strange is that it will work using the python window within ArcMap, but won't work as a standalone script. The layer created just contains all of the features...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.MakeFeatureLayer_management(meters, 'meter_layer', "'last_edited_date' &amp;gt;= 'DATEADD(d, 0, DATEDIFF(d, 0, GETDATE()))'", "", "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2019 20:38:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/make-feature-layer-based-off-last-edited-date/m-p/384316#M30277</guid>
      <dc:creator>TraceStanford1</dc:creator>
      <dc:date>2019-06-24T20:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Make feature layer based off last edited date</title>
      <link>https://community.esri.com/t5/python-questions/make-feature-layer-based-off-last-edited-date/m-p/384317#M30278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have had this problem as well. I make a feature layer without a definition query, then use the feature layer and use the Select by Attributes tool is where I put in the date query, then calculate field.&amp;nbsp;&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/451331_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2019 22:21:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/make-feature-layer-based-off-last-edited-date/m-p/384317#M30278</guid>
      <dc:creator>Brian_McLeer</dc:creator>
      <dc:date>2019-06-24T22:21:12Z</dc:date>
    </item>
  </channel>
</rss>

