<?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: Definition Query with start and end dates in ArcMap Questions</title>
    <link>https://community.esri.com/t5/arcmap-questions/definition-query-with-start-and-end-dates/m-p/1051322#M2411</link>
    <description>&lt;P&gt;We are using SQL Server 2017.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Apr 2021 14:55:19 GMT</pubDate>
    <dc:creator>MichaelScott2</dc:creator>
    <dc:date>2021-04-26T14:55:19Z</dc:date>
    <item>
      <title>Definition Query with start and end dates</title>
      <link>https://community.esri.com/t5/arcmap-questions/definition-query-with-start-and-end-dates/m-p/1051305#M2409</link>
      <description>&lt;P&gt;I have data in an SQL database that has fields for a start date (StartDate) and end date (EndDate).&lt;/P&gt;&lt;P&gt;My client would like the features to be visible only when the current date is between the start date and 45 day after the end date.&lt;/P&gt;&lt;P&gt;I have tried many different definition query iterations and looked at a lot of forum posts. The closest I have gotten to a working definition query is...&lt;/P&gt;&lt;P&gt;GetDate() &amp;gt;= StartDate AND EndDate &amp;lt;= GetDate() - 45&lt;/P&gt;&lt;P&gt;I'd like the second part to be GetDate() &amp;lt;= EndDate + 45, but that gives me a syntax error.&lt;/P&gt;&lt;P&gt;I can't seem to wrap my brain around the logic for this definition query.&lt;/P&gt;&lt;P&gt;Any assistance would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 14:21:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/definition-query-with-start-and-end-dates/m-p/1051305#M2409</guid>
      <dc:creator>MichaelScott2</dc:creator>
      <dc:date>2021-04-26T14:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Definition Query with start and end dates</title>
      <link>https://community.esri.com/t5/arcmap-questions/definition-query-with-start-and-end-dates/m-p/1051317#M2410</link>
      <description>&lt;P&gt;There is a fair amount of nuance/difference in how different DMBSs implement Date/Time SQL support.&amp;nbsp; Which back-end DBMS are you working with?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 14:44:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/definition-query-with-start-and-end-dates/m-p/1051317#M2410</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-04-26T14:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Definition Query with start and end dates</title>
      <link>https://community.esri.com/t5/arcmap-questions/definition-query-with-start-and-end-dates/m-p/1051322#M2411</link>
      <description>&lt;P&gt;We are using SQL Server 2017.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 14:55:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/definition-query-with-start-and-end-dates/m-p/1051322#M2411</guid>
      <dc:creator>MichaelScott2</dc:creator>
      <dc:date>2021-04-26T14:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Definition Query with start and end dates</title>
      <link>https://community.esri.com/t5/arcmap-questions/definition-query-with-start-and-end-dates/m-p/1051423#M2412</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GETDATE() BETWEEN StartDate and DATEADD(day, 45, EndDate)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GETDATE() &amp;gt;= StartDate AND GETDATE() &amp;lt;= DATEADD(day, 45, EndDate)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 17:58:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/definition-query-with-start-and-end-dates/m-p/1051423#M2412</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-04-26T17:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Definition Query with start and end dates</title>
      <link>https://community.esri.com/t5/arcmap-questions/definition-query-with-start-and-end-dates/m-p/1051443#M2413</link>
      <description>&lt;P&gt;Both solutions work.&lt;/P&gt;&lt;P&gt;Thank you so much.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 18:32:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/definition-query-with-start-and-end-dates/m-p/1051443#M2413</guid>
      <dc:creator>MichaelScott2</dc:creator>
      <dc:date>2021-04-26T18:32:28Z</dc:date>
    </item>
  </channel>
</rss>

