<?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: &amp;quot;date&amp;quot; vs &amp;quot;timestamp&amp;quot; use for SQL Query of date field in file geodatabase in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/quot-date-quot-vs-quot-timestamp-quot-use-for-sql/m-p/806250#M2899</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI: This is now an official bug -&amp;nbsp;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8; font-weight: 300;"&gt;#BUG-000129778&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8; font-weight: 300;"&gt;Make Query Table tool does not allow clause mode editing of SQL expression parameter.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Apr 2020 15:35:16 GMT</pubDate>
    <dc:creator>JoeBryant1</dc:creator>
    <dc:date>2020-04-01T15:35:16Z</dc:date>
    <item>
      <title>"date" vs "timestamp" use for SQL Query of date field in file geodatabase</title>
      <link>https://community.esri.com/t5/geodatabase-questions/quot-date-quot-vs-quot-timestamp-quot-use-for-sql/m-p/806247#M2896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;I had been trying to figure out why a SQL Query expression was giving me a syntax error using Model Builder in ArcGIS Pro. I had been constructing the query as instructed here:&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm" title="https://pro.arcgis.com/en/pro-app/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm"&gt;SQL reference for query expressions used in ArcGIS—ArcGIS Pro | Documentation&lt;/A&gt;, which says that you should use the word "date" before the string containing your date value in the expression. Example from that page:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #4c4c4c; background-color: #ffffff; font-size: 17px; margin-bottom: 1.55rem;"&gt;INCIDENT_DATE &amp;gt;= date '2011-01-01 00:00:00'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;However, this was giving me a syntax error when using the Make Query Table tool in ModelBuilder. (*Note: I was not able to edit the expression in Clause mode, which may be a bug related to the Make Query Tool &lt;A _jive_internal="true" href="https://community.esri.com/thread/213341-issue-with-make-query-table-toolare-there-others-in-pro"&gt;described here&lt;/A&gt;). It wasn't until I created the expression in the GP Pane that I saw that Pro was constructing the query as:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;Sampling_Date = timestamp '2020-02-10 00:00:00'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;As mentioned, this is using data from a table in file geodatabase, from a field of type date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;When do I use "date", and when do I use "timestamp"? Is it the difference between a date field in a FGDB feature class and an FGDB table?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2020 22:39:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/quot-date-quot-vs-quot-timestamp-quot-use-for-sql/m-p/806247#M2896</guid>
      <dc:creator>JoeBryant1</dc:creator>
      <dc:date>2020-03-20T22:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: "date" vs "timestamp" use for SQL Query of date field in file geodatabase</title>
      <link>https://community.esri.com/t5/geodatabase-questions/quot-date-quot-vs-quot-timestamp-quot-use-for-sql/m-p/806248#M2897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For file geodatabases, the DATE, TIME, and TIMESTAMP SQL data types all map to the same Esri Date data type.&amp;nbsp;&amp;nbsp; So, as far as file geodatabases are concerned, it doesn't matter which one you use when writing SQL statements. The reason the documentation focuses on using SQL DATE is because it shares the same name as Esri Date, so the shared name provides a logical transition working between the two.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case, you are not passing straight SQL to the file geodatabase, you are using another tool (Model Builder) to build an expression that is eventually passed to the file geodatabase.&amp;nbsp; The issue you are running into isn't with file geodatabases but either with Model Builder or possibly even Make Query tool.&amp;nbsp; The Make Query tool is somewhat infamous for how many issues it has with building proper syntax using the dialog tools.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Mar 2020 20:35:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/quot-date-quot-vs-quot-timestamp-quot-use-for-sql/m-p/806248#M2897</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-03-21T20:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: "date" vs "timestamp" use for SQL Query of date field in file geodatabase</title>
      <link>https://community.esri.com/t5/geodatabase-questions/quot-date-quot-vs-quot-timestamp-quot-use-for-sql/m-p/806249#M2898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for clarifying, Joshua.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did some tests and found that both "date" and "timestamp" run successfully in the Make Query Table tool. However, only the word "timestamp" auto-completes in &lt;SPAN style="color: #00ccff;"&gt;&lt;STRONG style="color: #3366ff; "&gt;blue&lt;/STRONG&gt;&amp;nbsp;&lt;SPAN style="color: #000000;"&gt;in the SQL query dialog box; "date" does not. I'm not sure why, but it must have some indication of what's going on behind the scenes in the software.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dragging the tool history into Model Builder also runs fine &lt;EM&gt;inside&lt;/EM&gt; Model Builder, with no warnings, in Clause and SQL query modes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I save the model and open it as a GP Tool, I get an error saying "Internal Error initializing expression."&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SQL query error initializing expression" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/486164_ErrorInitializingExpression.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I try to switch from SQL to Clause mode, I get a warning that "the source layer or table is not valid". This is with the input layer hard-coded into the tool, not set as a parameter.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Invalid source for Clause mode" class="jive-emoji jive-image image-2 j-img-original" src="https://community.esri.com/legacyfs/online/486165_InvalidSourceforClause.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This definitely backs up your assertion that this is a combination Model Builder / Make Query Table error, and has nothing to do with the data type keyword.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2020 23:55:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/quot-date-quot-vs-quot-timestamp-quot-use-for-sql/m-p/806249#M2898</guid>
      <dc:creator>JoeBryant1</dc:creator>
      <dc:date>2020-03-24T23:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: "date" vs "timestamp" use for SQL Query of date field in file geodatabase</title>
      <link>https://community.esri.com/t5/geodatabase-questions/quot-date-quot-vs-quot-timestamp-quot-use-for-sql/m-p/806250#M2899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI: This is now an official bug -&amp;nbsp;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8; font-weight: 300;"&gt;#BUG-000129778&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8; font-weight: 300;"&gt;Make Query Table tool does not allow clause mode editing of SQL expression parameter.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2020 15:35:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/quot-date-quot-vs-quot-timestamp-quot-use-for-sql/m-p/806250#M2899</guid>
      <dc:creator>JoeBryant1</dc:creator>
      <dc:date>2020-04-01T15:35:16Z</dc:date>
    </item>
  </channel>
</rss>

