<?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 Label in SQL calculate time Now + 12 hours in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-sql-calculate-time-now-12-hours/m-p/1295711#M69843</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need a label in SQL-expression with variable Time:&lt;/P&gt;&lt;P&gt;Label must be visible if:&lt;/P&gt;&lt;P&gt;start time &amp;gt; time now&lt;BR /&gt;Start time &amp;lt; time now + 12 hours&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a fault with this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;start &amp;gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;CurrentTime&lt;/SPAN&gt;&lt;SPAN&gt;() AND start &amp;lt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;DateAdd&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;CurrentTimestamp&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;SPAN class=""&gt;12&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;'hours'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jun 2023 08:41:10 GMT</pubDate>
    <dc:creator>NicolasSoenens</dc:creator>
    <dc:date>2023-06-05T08:41:10Z</dc:date>
    <item>
      <title>Label in SQL calculate time Now + 12 hours</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-sql-calculate-time-now-12-hours/m-p/1295711#M69843</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need a label in SQL-expression with variable Time:&lt;/P&gt;&lt;P&gt;Label must be visible if:&lt;/P&gt;&lt;P&gt;start time &amp;gt; time now&lt;BR /&gt;Start time &amp;lt; time now + 12 hours&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a fault with this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;start &amp;gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;CurrentTime&lt;/SPAN&gt;&lt;SPAN&gt;() AND start &amp;lt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;DateAdd&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;CurrentTimestamp&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;SPAN class=""&gt;12&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;'hours'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 08:41:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-sql-calculate-time-now-12-hours/m-p/1295711#M69843</guid>
      <dc:creator>NicolasSoenens</dc:creator>
      <dc:date>2023-06-05T08:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Label in SQL calculate time Now + 12 hours</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-sql-calculate-time-now-12-hours/m-p/1296284#M69896</link>
      <description>&lt;P&gt;With my test data written to in-memory:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DuncanHornby_0-1686065484593.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/72456iE48D2249EB4F3F31/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DuncanHornby_0-1686065484593.png" alt="DuncanHornby_0-1686065484593.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I can use the following SQL query to limit the data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;myDates &amp;gt; timestamp '2023-06-06 16:00:00' And myDates &amp;lt; timestamp '2023-06-07 04:00:00'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What expression you settle on is as I understand &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm#" target="_self"&gt;dictated by the underlying database&lt;/A&gt; you are storing your data within.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 15:34:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-sql-calculate-time-now-12-hours/m-p/1296284#M69896</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2023-06-06T15:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Label in SQL calculate time Now + 12 hours</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-sql-calculate-time-now-12-hours/m-p/1296564#M69938</link>
      <description>&lt;P&gt;Thanks for your answer but I need an expression where the 'time' is variable according to current time, like TIMSTAMP().&lt;BR /&gt;Goal:&lt;BR /&gt;I'm making a layer for a fire brigade dispatch that contains specific traffic obstacles that are not equal to those of the citizen (Wase is therefore not usable).&lt;BR /&gt;My objects are variable according to start and, end and obstacle type.&lt;/P&gt;&lt;P&gt;I have 2 layers:&lt;BR /&gt;- Operational layer of current traffic disruption according to the 3 variables.&lt;BR /&gt;This is finished and works. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; At any time, a dispatcher can enter traffic disruption, including disruption that will occur in the future. Only the current nuisance is visible on the operational layer.&lt;/P&gt;&lt;P&gt;- A layer with the traffic disruption that "will" start between current time and 12 hours later.&lt;BR /&gt;It is for that last layer that I ask this question. At any time of the day, TIMESTAMP() must be taken into account and not a pre-entered time.&lt;/P&gt;&lt;P&gt;So I'm looking for how to write the following for my labels:&lt;BR /&gt;TIMESTAMP() + 12 hours&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 07:53:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-sql-calculate-time-now-12-hours/m-p/1296564#M69938</guid>
      <dc:creator>NicolasSoenens</dc:creator>
      <dc:date>2023-06-07T07:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Label in SQL calculate time Now + 12 hours</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-sql-calculate-time-now-12-hours/m-p/1296579#M69942</link>
      <description>&lt;P&gt;So what is your underlying data store? A File GeoDatabase, Oracle, or even a shapefile?&amp;nbsp; I've always understood the SQL used by say a File GeoDatabase is some variant of the full capability of the SQL language and what you are asking may not be even possible.&lt;/P&gt;&lt;P&gt;You could try and explore using Arcade as away of bringing in the logic you require to disable/enable labelling.&amp;nbsp; That has a great range of date manipulating functions.&amp;nbsp; It seems to me the SQL query component is for filtering out data but you could probably return "nothing" as a label which would be effectively the same outcome?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 09:07:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-sql-calculate-time-now-12-hours/m-p/1296579#M69942</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2023-06-07T09:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Label in SQL calculate time Now + 12 hours</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-sql-calculate-time-now-12-hours/m-p/1296591#M69943</link>
      <description>&lt;P&gt;I'm currently starting from a hosted feature layer but the aim would be to get it on DB. (currently our server has a bug but Esri is working on it).&lt;/P&gt;&lt;P&gt;I fear that my question cannot be resolved at the moment.&lt;BR /&gt;Labeling is only in SQL and not in Arcade.&lt;BR /&gt;An additional problem with Arcade is that it does not take UTM and time zones into account.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/arcade-on-calculate-field-does-not-respect-the/m-p/1057384#M40868" target="_blank"&gt;https://community.esri.com/t5/arcgis-pro-questions/arcade-on-calculate-field-does-not-respect-the/m-p/1057384#M40868&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Once my data is on DB it will be easier to write a script from there to perform the correct calculations.&lt;/P&gt;&lt;P&gt;I was still hoping to be dumber than the rest and get a solution from a GIS genius. :-).&lt;/P&gt;&lt;P&gt;Thank you for thinking along.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 10:15:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-sql-calculate-time-now-12-hours/m-p/1296591#M69943</guid>
      <dc:creator>NicolasSoenens</dc:creator>
      <dc:date>2023-06-07T10:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Label in SQL calculate time Now + 12 hours</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-sql-calculate-time-now-12-hours/m-p/1296593#M69944</link>
      <description>&lt;P&gt;I just recieved an answer from ESRI: It's a Bug in ArGIS Pro:&lt;/P&gt;&lt;P&gt;I will try the solution they propose:&lt;/P&gt;&lt;P&gt;As for the workaround you applied to 'now()', it seems that this is a bug in ArcGIS Pro. In the bug I found some information that might be interesting to possibly work around the problem:&lt;/P&gt;&lt;P&gt;1) A first workaround (in this case for calculating fields in an attribute table) that is suggested is the following:&lt;BR /&gt;Use Calculate Field with Python 3 as Expression Type and with Date functions, such as datetime.datetime.now() to populate the local current time:&lt;/P&gt;&lt;P&gt;Right-click the Date Field &amp;gt; Calculate Field.&lt;BR /&gt;Expression: Python 3.&lt;BR /&gt;Click the Filter icon next to Helpers &amp;gt; Date. Choose any compatible Helpers (Example: datetime.datetime.now())&lt;BR /&gt;Click Apply.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 10:32:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-sql-calculate-time-now-12-hours/m-p/1296593#M69944</guid>
      <dc:creator>NicolasSoenens</dc:creator>
      <dc:date>2023-06-07T10:32:49Z</dc:date>
    </item>
  </channel>
</rss>

