<?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: Model Builder SQL Expression in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-sql-expression/m-p/873201#M3774</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check your error message I'm not sure you can use PM in the date field try using a date from a select by attribute Get Unique Values test&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #2873ee;"&gt;Date =&amp;gt; '3/1/2016 3:33:02 PM'&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Mar 2016 13:57:57 GMT</pubDate>
    <dc:creator>WesMiller</dc:creator>
    <dc:date>2016-03-31T13:57:57Z</dc:date>
    <item>
      <title>Model Builder SQL Expression</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-sql-expression/m-p/873198#M3771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I am trying to set up a tool to query based on a date range and secondary field &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created three Variables that i have set up as&amp;nbsp; Parameters, Start Date, End Date, Customer_Code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the customer code selecting correctly however i get an error when i include my date range.&lt;/P&gt;&lt;P&gt;(Date &amp;gt;= '%Start Date%' AND Date &amp;lt;='%End Date%') AND Customer_Code = '%Customer Code%'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the error i get&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee;"&gt;&lt;EM&gt;NEW_SELECTION "Customer_Code = '35' AND Date =&amp;gt; '3/1/2016 3:33:02 PM'"&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee;"&gt;&lt;EM&gt;Start Time: Wed Mar 30 16:06:22 2016&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee;"&gt;&lt;EM&gt;ERROR 000358: Invalid expression&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee;"&gt;&lt;EM&gt;An invalid SQL statement was used.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee;"&gt;&lt;EM&gt;An invalid SQL statement was used. [Customers_3_24_16]&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee;"&gt;&lt;EM&gt;An invalid SQL statement was used. [SELECT OBJECTID FROM Customers_3_24_16 WHERE Customer_Code = '35' AND Date =&amp;gt; '3/1/2016 3:33:02 PM']&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee;"&gt;&lt;EM&gt;Failed to execute (Select Layer By Attribute).&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee;"&gt;&lt;EM&gt;Failed at Wed Mar 30 16:06:22 2016 (Elapsed Time: 0.00 seconds)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the issue is that when i apply a definition query my date values look as like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date = date '2016-03-01 00:10:00'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 21:12:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-builder-sql-expression/m-p/873198#M3771</guid>
      <dc:creator>deleted-user-V6usQu8yPcp9</dc:creator>
      <dc:date>2016-03-30T21:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder SQL Expression</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-sql-expression/m-p/873199#M3772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dates are tough to work with, i suggest you use select by attribute to see the format the date query is looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 23:22:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-builder-sql-expression/m-p/873199#M3772</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2016-03-30T23:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder SQL Expression</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-sql-expression/m-p/873200#M3773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have my SQL expression going connected to a select by attributes i think the issue is the &lt;EM&gt;"&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Date = date '2016-03-01 00:10:00'"&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;not sure if this is an issue but i have underlined and made bold the part that might be stopping it from working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date = &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;date&lt;/STRONG&gt;&lt;/SPAN&gt; '2016-03-01 00: 00:00' &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 12:55:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-builder-sql-expression/m-p/873200#M3773</guid>
      <dc:creator>deleted-user-V6usQu8yPcp9</dc:creator>
      <dc:date>2016-03-31T12:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder SQL Expression</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-sql-expression/m-p/873201#M3774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check your error message I'm not sure you can use PM in the date field try using a date from a select by attribute Get Unique Values test&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #2873ee;"&gt;Date =&amp;gt; '3/1/2016 3:33:02 PM'&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 13:57:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-builder-sql-expression/m-p/873201#M3774</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2016-03-31T13:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder SQL Expression</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-sql-expression/m-p/873202#M3775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The biggest problem is that date-time formats are often format and database-specific. It looks in the help like Wes is correct that PM is not likely to work for most data sources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/map/working-with-layers/sql-reference-for-query-expressions-used-in-arcgis.htm#GUID-85C03D85-F4A5-48FC-8E8C-3F79919430DB" title="http://desktop.arcgis.com/en/arcmap/latest/map/working-with-layers/sql-reference-for-query-expressions-used-in-arcgis.htm#GUID-85C03D85-F4A5-48FC-8E8C-3F79919430DB"&gt;SQL reference for query expressions used in ArcGIS—Help | ArcGIS for Desktop&amp;nbsp; (Working with date and time)&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The format you reference is correct for file geodatabase:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;Datefield = date 'yyyy-mm-dd hh:mm:ss'&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 05:09:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-builder-sql-expression/m-p/873202#M3775</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2016-04-06T05:09:04Z</dc:date>
    </item>
  </channel>
</rss>

