<?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: Why is this SQL expression invalid? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/why-is-this-sql-expression-invalid/m-p/1127029#M49127</link>
    <description>&lt;P&gt;What DB system are you on? That article references a few other formats for things like Oracle, Postgres, etc.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Dec 2021 00:15:59 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2021-12-17T00:15:59Z</dc:date>
    <item>
      <title>Why is this SQL expression invalid?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/why-is-this-sql-expression-invalid/m-p/1127012#M49123</link>
      <description>&lt;P&gt;I'm upgrading a model that processes GPS Points. From the GPS device we can only get a table with every point, so I'm trying to create additional function that will go to the ultimate GDB and get the last date in the field "Start_Time" which is a date field. I achieve this by sorting by descending of this field and then "Get Field Value" from utilities into a date variable. Where I'm stuck is making the SQL expression using inline replacement to delete all the values that are lower than the variable I got from the server. However everything I've tried returns an error saying the expression is invalid.&lt;/P&gt;&lt;P&gt;Expressions I've tried based off &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm" target="_self"&gt;this article&lt;/A&gt;:&lt;/P&gt;&lt;PRE&gt;Start_Time &amp;gt;= date %Last_Start_Date%&lt;BR /&gt;"Start_Time" &amp;gt;= date %Last_Start_Date%&lt;BR /&gt;Start_Time &amp;gt;= %Last_Start_Date%&lt;BR /&gt;"Start_Time" &amp;gt;= %Last_Start_Date%&lt;BR /&gt;Start_Time &amp;gt;= /'%Last_Start_Date%/'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The value that the variable reports is:&lt;/P&gt;&lt;PRE&gt;2/12/2021 5:00:41 AM&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't really know what else to try. Its really hard to understand why it doesn't work when the error just says it doesn't work.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 23:39:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/why-is-this-sql-expression-invalid/m-p/1127012#M49123</guid>
      <dc:creator>ChrisCowin</dc:creator>
      <dc:date>2021-12-16T23:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why is this SQL expression invalid?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/why-is-this-sql-expression-invalid/m-p/1127029#M49127</link>
      <description>&lt;P&gt;What DB system are you on? That article references a few other formats for things like Oracle, Postgres, etc.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 00:15:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/why-is-this-sql-expression-invalid/m-p/1127029#M49127</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-12-17T00:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why is this SQL expression invalid?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/why-is-this-sql-expression-invalid/m-p/1127030#M49128</link>
      <description>&lt;P&gt;Just a regular old GDB, nothing fancy. I tried changing the variable to a string and then used:&lt;/P&gt;&lt;PRE&gt;Start_Time &amp;lt;= date '%Last_Start_Date%'&lt;/PRE&gt;&lt;P&gt;That seems to have worked, but think its a little odd I can't do that directly since its already in a date field.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 00:21:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/why-is-this-sql-expression-invalid/m-p/1127030#M49128</guid>
      <dc:creator>ChrisCowin</dc:creator>
      <dc:date>2021-12-17T00:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why is this SQL expression invalid?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/why-is-this-sql-expression-invalid/m-p/1666459#M100192</link>
      <description>&lt;P&gt;Still having this problem in 2025.&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/15282"&gt;@esriesri&lt;/a&gt;&amp;nbsp;Plz fix! I'd like be able to use a date parameter without needing the SQL editor.&lt;/P&gt;&lt;P&gt;Thanks so much&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/132016"&gt;@ChrisCowin&lt;/a&gt;&amp;nbsp;for the workaround!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specific use case was: In Model Builder, using the Select tool where one of the selection criteria was [DateColumn] &amp;gt;= [user-defined, single-value parameter]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only thing I could think of that might cause issue was that:&lt;/P&gt;&lt;P&gt;[DateColumn] has the format 'dd-MMM-yy hh:mm:ss.&lt;STRONG&gt;sss&lt;/STRONG&gt;',&lt;/P&gt;&lt;P&gt;[user-defined parameter] could only be entered as 'dd-MMM-yy hh:mm:ss'&amp;nbsp;when (data type=date)&lt;/P&gt;&lt;P&gt;(the trailing milliseconds were omitted). Wondering if the discrepancy in data format is what caused the issue?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Nov 2025 20:04:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/why-is-this-sql-expression-invalid/m-p/1666459#M100192</guid>
      <dc:creator>AYamaguchi_UGRWCD</dc:creator>
      <dc:date>2025-11-17T20:04:29Z</dc:date>
    </item>
  </channel>
</rss>

