<?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 Issue using date as an inline variable substituion in ModelBuilder in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/issue-using-date-as-an-inline-variable-substituion/m-p/1494976#M27322</link>
    <description>&lt;P&gt;I'm using ModelBuilder to iterate through a number of point features, extracting a date from each using 'Get Field Value'. The select tool is then used to select features from another dataset, which have a date on or before the date extracted from the current point. Both date fields are formatted in the format DD/MM/YYYY.&lt;/P&gt;&lt;P&gt;My issue lies with the comparison I'm using in the select tool. From &lt;A href="https://community.esri.com/t5/modelbuilder-questions/query-date-in-model-builder-with-inline-variable/td-p/843682" target="_self"&gt;other posts&lt;/A&gt; I've seen it seems that Get Field Value treats the output of the iterated field as a string, even if the data type is set to date. To allow for this, I've used the following expression in the select:&lt;/P&gt;&lt;P&gt;AddedDate &amp;lt;= CAST('%pointDate%' AS DATE)&lt;/P&gt;&lt;P&gt;This seems to work for the majority of cases, however I've noticed a discrepancy in my outputs that seems to arise be due to a clash between the US and UK date formating. It seems some points are erroneously selecting some polygons because although the polygons start date is later when read as DD/MM/YYYY, it occurs before if the same string is read as MM/YY/DDDD. (i.e. a point with a 12th January date is being interpreted as being 1st December). Can someone help me to address this?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-06-19 164014.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107445i40D2A926933665F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-06-19 164014.png" alt="Screenshot 2024-06-19 164014.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-06-19 163955.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107444i7918D4B7F9E146BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-06-19 163955.png" alt="Screenshot 2024-06-19 163955.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2024 15:43:50 GMT</pubDate>
    <dc:creator>KatieSelfEd</dc:creator>
    <dc:date>2024-06-19T15:43:50Z</dc:date>
    <item>
      <title>Issue using date as an inline variable substituion in ModelBuilder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/issue-using-date-as-an-inline-variable-substituion/m-p/1494976#M27322</link>
      <description>&lt;P&gt;I'm using ModelBuilder to iterate through a number of point features, extracting a date from each using 'Get Field Value'. The select tool is then used to select features from another dataset, which have a date on or before the date extracted from the current point. Both date fields are formatted in the format DD/MM/YYYY.&lt;/P&gt;&lt;P&gt;My issue lies with the comparison I'm using in the select tool. From &lt;A href="https://community.esri.com/t5/modelbuilder-questions/query-date-in-model-builder-with-inline-variable/td-p/843682" target="_self"&gt;other posts&lt;/A&gt; I've seen it seems that Get Field Value treats the output of the iterated field as a string, even if the data type is set to date. To allow for this, I've used the following expression in the select:&lt;/P&gt;&lt;P&gt;AddedDate &amp;lt;= CAST('%pointDate%' AS DATE)&lt;/P&gt;&lt;P&gt;This seems to work for the majority of cases, however I've noticed a discrepancy in my outputs that seems to arise be due to a clash between the US and UK date formating. It seems some points are erroneously selecting some polygons because although the polygons start date is later when read as DD/MM/YYYY, it occurs before if the same string is read as MM/YY/DDDD. (i.e. a point with a 12th January date is being interpreted as being 1st December). Can someone help me to address this?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-06-19 164014.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107445i40D2A926933665F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-06-19 164014.png" alt="Screenshot 2024-06-19 164014.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-06-19 163955.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107444i7918D4B7F9E146BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-06-19 163955.png" alt="Screenshot 2024-06-19 163955.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 15:43:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/issue-using-date-as-an-inline-variable-substituion/m-p/1494976#M27322</guid>
      <dc:creator>KatieSelfEd</dc:creator>
      <dc:date>2024-06-19T15:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using date as an inline variable substituion in ModelBuilder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/issue-using-date-as-an-inline-variable-substituion/m-p/1495234#M27324</link>
      <description>&lt;P&gt;Quick follow-up to add: I've found a workaround. Changing my system time format to US (which then changed the ArcPro format) seems to have resolved the behaviour. But I would appreciate a coded solution if possible!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 08:42:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/issue-using-date-as-an-inline-variable-substituion/m-p/1495234#M27324</guid>
      <dc:creator>KatieSelfEd</dc:creator>
      <dc:date>2024-06-20T08:42:09Z</dc:date>
    </item>
  </channel>
</rss>

