<?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 Model builder date variable in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-date-variable/m-p/871250#M2485</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to add a date variable in an expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with a FGDB in &amp;nbsp;ArcGIS &amp;nbsp;10.2&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two variables in Model Builder script:&lt;/P&gt;&lt;P&gt;&amp;nbsp; - DateFrom populated with 5/1/2017 1:03:07 PM&lt;/P&gt;&lt;P&gt;&amp;nbsp; - DateTo populated &amp;nbsp;with&amp;nbsp;5/31/2017 1:03:23 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;an the expression I tried with MakeFeature:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CRTDATE &amp;gt;= %DateFrom% &amp;nbsp;and \nCRTDATE &amp;nbsp;&amp;lt;= %DateTo% &amp;nbsp;=&amp;gt; fails&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CRTDATE &amp;gt;= #%DateFrom%# &amp;nbsp;and \nCRTDATE &amp;nbsp;&amp;lt;= #%DateTo%# &amp;nbsp; &amp;nbsp;=&amp;gt; fails&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 000230: Failed selecting with CRTDATE &amp;gt;= #5/1/2017 1:03:07 PM# and \nCRTDATE &amp;lt;= #5/31/2017 1:03:23 PM#&lt;BR /&gt;An invalid SQL statement was used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 May 2017 17:23:16 GMT</pubDate>
    <dc:creator>JoseSanchez</dc:creator>
    <dc:date>2017-05-26T17:23:16Z</dc:date>
    <item>
      <title>Model builder date variable</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-date-variable/m-p/871250#M2485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to add a date variable in an expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with a FGDB in &amp;nbsp;ArcGIS &amp;nbsp;10.2&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two variables in Model Builder script:&lt;/P&gt;&lt;P&gt;&amp;nbsp; - DateFrom populated with 5/1/2017 1:03:07 PM&lt;/P&gt;&lt;P&gt;&amp;nbsp; - DateTo populated &amp;nbsp;with&amp;nbsp;5/31/2017 1:03:23 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;an the expression I tried with MakeFeature:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CRTDATE &amp;gt;= %DateFrom% &amp;nbsp;and \nCRTDATE &amp;nbsp;&amp;lt;= %DateTo% &amp;nbsp;=&amp;gt; fails&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CRTDATE &amp;gt;= #%DateFrom%# &amp;nbsp;and \nCRTDATE &amp;nbsp;&amp;lt;= #%DateTo%# &amp;nbsp; &amp;nbsp;=&amp;gt; fails&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 000230: Failed selecting with CRTDATE &amp;gt;= #5/1/2017 1:03:07 PM# and \nCRTDATE &amp;lt;= #5/31/2017 1:03:23 PM#&lt;BR /&gt;An invalid SQL statement was used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 17:23:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-builder-date-variable/m-p/871250#M2485</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2017-05-26T17:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Model builder date variable</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-date-variable/m-p/871251#M2486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would avoid the embedded newline in the expression. The syntax is data source dependent, for file geodatabase try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="line-numbers language-sql"&gt;&lt;CODE&gt;CRTDATE &lt;SPAN class="operator token"&gt;&amp;gt;=&lt;/SPAN&gt; date &lt;SPAN class="string token"&gt;'%DateFrom%'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;AND&lt;/SPAN&gt; CRTDATE&amp;nbsp; &lt;SPAN class="operator token"&gt;&amp;lt;=&lt;/SPAN&gt; date &lt;SPAN class="string token"&gt;'%DateTo%‍‍‍'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I got the syntax from the help. I have this one bookmarked!&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" 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 Desktop&lt;/A&gt;&amp;nbsp; (dates and times)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 18:25:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-builder-date-variable/m-p/871251#M2486</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2017-05-26T18:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Model builder date variable</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-date-variable/m-p/871252#M2487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your format works thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CRTDATE &amp;gt;= &amp;nbsp;date &amp;nbsp;'%DateFrom%' &amp;nbsp;and CRTDATE &amp;nbsp;&amp;lt;= date &amp;nbsp;'%DateTo%'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 18:36:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-builder-date-variable/m-p/871252#M2487</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2017-05-26T18:36:15Z</dc:date>
    </item>
  </channel>
</rss>

