<?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: How can I write a definition query for feature classes to divide a larger table by year? in Spatial Data Science Questions</title>
    <link>https://community.esri.com/t5/spatial-data-science-questions/how-can-i-write-a-definition-query-for-feature/m-p/247442#M573</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Joshua,&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I will try that.&amp;nbsp; My coworker Ryan did get it to work without between:&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt;=&amp;nbsp; CURRENT_DATE AND Delivery_Date &amp;gt;= CURRENT_DATE - 365&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt;=&amp;nbsp; CURRENT_DATE -365 AND Delivery_Date &amp;gt;= CURRENT_DATE -730&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt;=&amp;nbsp; CURRENT_DATE -730 AND Delivery_Date &amp;gt;= CURRENT_DATE -1095&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt;=&amp;nbsp; CURRENT_DATE -1095 AND Delivery_Date &amp;gt;= CURRENT_DATE -1460&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt;=&amp;nbsp; CURRENT_DATE -1460 AND Delivery_Date &amp;gt;= CURRENT_DATE -1825&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt; CURRENT_DATE -1825&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Jay&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Jan 2019 18:48:55 GMT</pubDate>
    <dc:creator>JayJohnson2</dc:creator>
    <dc:date>2019-01-15T18:48:55Z</dc:date>
    <item>
      <title>How can I write a definition query for feature classes to divide a larger table by year?</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/how-can-i-write-a-definition-query-for-feature/m-p/247440#M571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My source data is a set of annual tables that have been merged into one. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use these definition queries, only the first one works.&amp;nbsp; Is there an error in my SQL statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;gt; date '2018-01-15 00:00:00'&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt; date '2018-01-15 00:00:00' AND Delivery_Date &amp;gt; date '2017-01-15 00:00:00'&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt; date '2017-01-15 00:00:00' AND Delivery_Date &amp;gt; date '2016-01-15 00:00:00'&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt; date '2016-01-15 00:00:00' AND Delivery_Date &amp;gt; date '2015-01-15 00:00:00'&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt; date '2015-01-15 00:00:00' AND Delivery_Date &amp;gt; date '2014-01-15 00:00:00'&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;gt; date '2014-01-15 00:00:00'&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;The data works fine as separate feature classes.&amp;nbsp; My client requested I do it this way.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2019 14:53:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/how-can-i-write-a-definition-query-for-feature/m-p/247440#M571</guid>
      <dc:creator>JayJohnson2</dc:creator>
      <dc:date>2019-01-15T14:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: How can I write a definition query for feature classes to divide a larger table by year?</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/how-can-i-write-a-definition-query-for-feature/m-p/247441#M572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For one, make sure the date field is indexed or you will be suffering some terrible performance with data from the layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When working with ranges in file geodatabases, whether dates or numbers in general, BETWEEN performs better.&amp;nbsp; What happens if you try:&lt;/P&gt;&lt;PRE class="line-numbers language-sql"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;Status&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Completed'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;AND&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Delivery_Date &lt;SPAN class="operator token"&gt;BETWEEN&lt;/SPAN&gt; date &lt;SPAN class="string token"&gt;'2017-01-15 00:00:00'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;AND&lt;/SPAN&gt; date &lt;SPAN class="string token"&gt;'2018-01-15 00:00:00'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2019 16:22:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/how-can-i-write-a-definition-query-for-feature/m-p/247441#M572</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-01-15T16:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I write a definition query for feature classes to divide a larger table by year?</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/how-can-i-write-a-definition-query-for-feature/m-p/247442#M573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Joshua,&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I will try that.&amp;nbsp; My coworker Ryan did get it to work without between:&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt;=&amp;nbsp; CURRENT_DATE AND Delivery_Date &amp;gt;= CURRENT_DATE - 365&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt;=&amp;nbsp; CURRENT_DATE -365 AND Delivery_Date &amp;gt;= CURRENT_DATE -730&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt;=&amp;nbsp; CURRENT_DATE -730 AND Delivery_Date &amp;gt;= CURRENT_DATE -1095&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt;=&amp;nbsp; CURRENT_DATE -1095 AND Delivery_Date &amp;gt;= CURRENT_DATE -1460&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt;=&amp;nbsp; CURRENT_DATE -1460 AND Delivery_Date &amp;gt;= CURRENT_DATE -1825&lt;/DIV&gt;&lt;DIV&gt;Status = 'Completed' AND Delivery_Date &amp;lt; CURRENT_DATE -1825&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Jay&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2019 18:48:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/how-can-i-write-a-definition-query-for-feature/m-p/247442#M573</guid>
      <dc:creator>JayJohnson2</dc:creator>
      <dc:date>2019-01-15T18:48:55Z</dc:date>
    </item>
  </channel>
</rss>

