<?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 Updating point symbology based on sql expression - is this the right way to go? in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/updating-point-symbology-based-on-sql-expression/m-p/639691#M36174</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all - I am a newbie to Sql and am trying to convert some sql statements that a consultant put together for our old IMS/SQL set up, to work with our new ArcSDE/SQL set up and am wondering what the right approach is.&amp;nbsp; At the end of this post are the original Sql statements for reference. I feel like this is an easier solution through ArcMap (V.10) etc, but I'm just not putting it together.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The situation is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a point file that has a 1:Many relationship with a non-spatial table. For example: Point #1 has 3 different maintenance issues that need fixing at that location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need the symbology of the points to be based on the completion of the issues:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;When none of the issues have been fixed, the point is symbolized as a red circle.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;When some of the issues have been fixed, the point turns to a green, half circle.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;When all 3 issues have been fixed, the point turns to a green circle.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;In the past version, this was accomplished by basing the symbology on a "STATUS" field that referenced the 'CompletedDate' field in the related table. &lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;If the date was null (ie: nothing had been worked on), the Status field would = 0, and the point color = Red.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;If the date was not null, Status = 1 (and the point would be half green), and&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;If the CompletedDate (as a DateCount ) in the related table was equal to the number of issues in the RecordCount field, the point would turn green.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;Below are the old 2005 sql statements. I'm wondering if this is something that I can run from inside the MXD instead of needing to go into the acutal SQL database. That whenever there is a date entered in the CompletedDate field the Status field will automatically update and voila(!), the point color will change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We're using Enterprise v.10, SQL Server 2008, Flex 4.0 (where the editing will happen). We are not using versioned tables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any words of wisdom, or suggestions on how to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you, Meg&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;____________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;STORED PROCEDURE&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;CREATE PROCEDURE [sql_data].[sp_Update_ADASTATS]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;truncate table sql_data.ADASTATS;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;INSERT INTO sql_data.ADASTATS SELECT DISTINCT FACILITYZONEID UNIQCODE, '0', COUNT(*) FROM sql_data.ADA_Actions GROUP BY FACILITYZONEID;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UPDATE sql_data.ADASTATS SET STATUS=1 WHERE sql_data.ADASTATS.UNIQCODE IN (SELECT DISTINCT FACILITYZONEID UNIQCODE FROM sql_data.ADA_Actions WHERE CompletedDate IS NOT NULL);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UPDATE sql_data.ADASTATS SET STATUS=2 WHERE sql_data.ADASTATS.UNIQCODE IN (SELECT DISTINCT UNIQCODE FROM sql_data.vw_ADASTATS WHERE DateCount = RecCount);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GO&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;____________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VIEW&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sql_data.ADASTATS.UNIQCODE, Sql_data.ADASTATS.RECCOUNT, COUNT(Sql_data.ADA_Actions.CompletedDate) AS DateCount&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sql_data.ADA_Actions INNER JOIN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sql_data.ADASTATS ON Sql_data.ADA_Actions.FacilityZoneID = Sql_data.ADASTATS.UNIQCODE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WHERE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Sql_data.ADA_Actions.CompletedDate IS NOT NULL)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GROUP BY Sql_data.ADASTATS.UNIQCODE, Sql_data.ADASTATS.RECCOUNT&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Apr 2012 20:46:53 GMT</pubDate>
    <dc:creator>MegPeterson</dc:creator>
    <dc:date>2012-04-12T20:46:53Z</dc:date>
    <item>
      <title>Updating point symbology based on sql expression - is this the right way to go?</title>
      <link>https://community.esri.com/t5/data-management-questions/updating-point-symbology-based-on-sql-expression/m-p/639691#M36174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all - I am a newbie to Sql and am trying to convert some sql statements that a consultant put together for our old IMS/SQL set up, to work with our new ArcSDE/SQL set up and am wondering what the right approach is.&amp;nbsp; At the end of this post are the original Sql statements for reference. I feel like this is an easier solution through ArcMap (V.10) etc, but I'm just not putting it together.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The situation is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a point file that has a 1:Many relationship with a non-spatial table. For example: Point #1 has 3 different maintenance issues that need fixing at that location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need the symbology of the points to be based on the completion of the issues:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;When none of the issues have been fixed, the point is symbolized as a red circle.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;When some of the issues have been fixed, the point turns to a green, half circle.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;When all 3 issues have been fixed, the point turns to a green circle.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;In the past version, this was accomplished by basing the symbology on a "STATUS" field that referenced the 'CompletedDate' field in the related table. &lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;If the date was null (ie: nothing had been worked on), the Status field would = 0, and the point color = Red.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;If the date was not null, Status = 1 (and the point would be half green), and&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;If the CompletedDate (as a DateCount ) in the related table was equal to the number of issues in the RecordCount field, the point would turn green.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;Below are the old 2005 sql statements. I'm wondering if this is something that I can run from inside the MXD instead of needing to go into the acutal SQL database. That whenever there is a date entered in the CompletedDate field the Status field will automatically update and voila(!), the point color will change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We're using Enterprise v.10, SQL Server 2008, Flex 4.0 (where the editing will happen). We are not using versioned tables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any words of wisdom, or suggestions on how to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you, Meg&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;____________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;STORED PROCEDURE&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;CREATE PROCEDURE [sql_data].[sp_Update_ADASTATS]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;truncate table sql_data.ADASTATS;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;INSERT INTO sql_data.ADASTATS SELECT DISTINCT FACILITYZONEID UNIQCODE, '0', COUNT(*) FROM sql_data.ADA_Actions GROUP BY FACILITYZONEID;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UPDATE sql_data.ADASTATS SET STATUS=1 WHERE sql_data.ADASTATS.UNIQCODE IN (SELECT DISTINCT FACILITYZONEID UNIQCODE FROM sql_data.ADA_Actions WHERE CompletedDate IS NOT NULL);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UPDATE sql_data.ADASTATS SET STATUS=2 WHERE sql_data.ADASTATS.UNIQCODE IN (SELECT DISTINCT UNIQCODE FROM sql_data.vw_ADASTATS WHERE DateCount = RecCount);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GO&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;____________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VIEW&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sql_data.ADASTATS.UNIQCODE, Sql_data.ADASTATS.RECCOUNT, COUNT(Sql_data.ADA_Actions.CompletedDate) AS DateCount&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sql_data.ADA_Actions INNER JOIN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sql_data.ADASTATS ON Sql_data.ADA_Actions.FacilityZoneID = Sql_data.ADASTATS.UNIQCODE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WHERE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Sql_data.ADA_Actions.CompletedDate IS NOT NULL)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GROUP BY Sql_data.ADASTATS.UNIQCODE, Sql_data.ADASTATS.RECCOUNT&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 20:46:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/updating-point-symbology-based-on-sql-expression/m-p/639691#M36174</guid>
      <dc:creator>MegPeterson</dc:creator>
      <dc:date>2012-04-12T20:46:53Z</dc:date>
    </item>
  </channel>
</rss>

