 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Duplicate Records</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/duplicate-records-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/duplicate-records-3/</link>
	<description></description>
	<lastBuildDate>Tue, 21 May 2013 08:51:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: lorit</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/duplicate-records-3/#comment-72171</link>
		<dc:creator>lorit</dc:creator>
		<pubDate>Mon, 04 Jan 2010 16:53:07 +0000</pubDate>
		<guid isPermaLink="false">#comment-72171</guid>
		<description><![CDATA[Thank you Phil and Tom!  I appreciate your help and quick response.]]></description>
		<content:encoded><![CDATA[<p>Thank you Phil and Tom!  I appreciate your help and quick response.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jennymack</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/duplicate-records-3/#comment-72161</link>
		<dc:creator>jennymack</dc:creator>
		<pubDate>Mon, 04 Jan 2010 15:32:26 +0000</pubDate>
		<guid isPermaLink="false">#comment-72161</guid>
		<description><![CDATA[Phil and Tom,

Thanks for contributing so much to this answer! Lorit, let us know if they&#039;ve helped you reach a solution.

Thanks,
Jenny]]></description>
		<content:encoded><![CDATA[<p>Phil and Tom,</p>
<p>Thanks for contributing so much to this answer! Lorit, let us know if they&#8217;ve helped you reach a solution.</p>
<p>Thanks,<br />
Jenny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/duplicate-records-3/#comment-72147</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Mon, 04 Jan 2010 02:54:44 +0000</pubDate>
		<guid isPermaLink="false">#comment-72147</guid>
		<description><![CDATA[Ohh - you are trying to join 5 comments with 4 adjustment records on the taxbill_no - you will get 20 output records -- but you might want 4.  Ideally the adjustment record and the comment would have a comment number field so you can join these files on the taxbill_no and the comment#.  With what you have you could join them on the taxbill_no and the amount giving 3 records or the taxbill_no and the credit giviing 1 more record but  this plan will fail if there are two payments for the same amount or two credits for the same amount.  So there is no way I can see to get the adjustments linked with the comments without a database change.]]></description>
		<content:encoded><![CDATA[<p>Ohh &#8211; you are trying to join 5 comments with 4 adjustment records on the taxbill_no &#8211; you will get 20 output records &#8212; but you might want 4.  Ideally the adjustment record and the comment would have a comment number field so you can join these files on the taxbill_no and the comment#.  With what you have you could join them on the taxbill_no and the amount giving 3 records or the taxbill_no and the credit giviing 1 more record but  this plan will fail if there are two payments for the same amount or two credits for the same amount.  So there is no way I can see to get the adjustments linked with the comments without a database change.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/duplicate-records-3/#comment-72108</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Thu, 31 Dec 2009 16:47:21 +0000</pubDate>
		<guid isPermaLink="false">#comment-72108</guid>
		<description><![CDATA[SELECT “T16.GNAM”.N_NAME, “T16.GNAM”.N_CITY,
sum(”T16.CADJ”.AD_TOTAL_ADJUSTMENT) 
FROM  QS36F.”T16.CPRP” AS “T16.CPRP”,
     QS36F.”T16.GNAM” AS “T16.GNAM”,
     QS36F.”T16.CADJ” AS “T16.CADJ”,
     QS36F.”T16.CRDC” AS “T16.CRDC”

WHERE “T16.CADJ”.AD_TAXBILL_NO = “T16.CPRP”.CP_TAXBILL_NO
AND “T16.CPRP”.CP_PRIMARY_TAXPAYER = “T16.GNAM”.N_ID_NR
AND “T16.CADJ”.AD_ADJUSTMENT_DATE &gt; 20091106 AND “T16.CADJ”.AD_ADJUSTMENT_DATE &lt; 20091205 AND “T16.CADJ”.AD_TOTAL_ADJUSTMENT &gt; -100.00
and “T16.CADJ”.AD_REASON IN (’C ‘, ‘R ‘)
Group by “T16.GNAM”.N_NAME, “T16.GNAM”.N_CITY;

Sorry, I think that&#039;s a little closer.  It will sum by name, city which would be correct provided every name, city is unique - not likely.  It cannot include the comments and you may want to add an order by clause.
Phil
Phil]]></description>
		<content:encoded><![CDATA[<p>SELECT “T16.GNAM”.N_NAME, “T16.GNAM”.N_CITY,<br />
sum(”T16.CADJ”.AD_TOTAL_ADJUSTMENT)<br />
FROM  QS36F.”T16.CPRP” AS “T16.CPRP”,<br />
     QS36F.”T16.GNAM” AS “T16.GNAM”,<br />
     QS36F.”T16.CADJ” AS “T16.CADJ”,<br />
     QS36F.”T16.CRDC” AS “T16.CRDC”</p>
<p>WHERE “T16.CADJ”.AD_TAXBILL_NO = “T16.CPRP”.CP_TAXBILL_NO<br />
AND “T16.CPRP”.CP_PRIMARY_TAXPAYER = “T16.GNAM”.N_ID_NR<br />
AND “T16.CADJ”.AD_ADJUSTMENT_DATE &gt; 20091106 AND “T16.CADJ”.AD_ADJUSTMENT_DATE &lt; 20091205 AND “T16.CADJ”.AD_TOTAL_ADJUSTMENT &gt; -100.00<br />
and “T16.CADJ”.AD_REASON IN (’C ‘, ‘R ‘)<br />
Group by “T16.GNAM”.N_NAME, “T16.GNAM”.N_CITY;</p>
<p>Sorry, I think that&#8217;s a little closer.  It will sum by name, city which would be correct provided every name, city is unique &#8211; not likely.  It cannot include the comments and you may want to add an order by clause.<br />
Phil<br />
Phil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/duplicate-records-3/#comment-72107</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Thu, 31 Dec 2009 16:40:19 +0000</pubDate>
		<guid isPermaLink="false">#comment-72107</guid>
		<description><![CDATA[SELECT  &quot;T16.GNAM&quot;.N_NAME, &quot;T16.GNAM&quot;.N_CITY, 
sum(&quot;T16.CADJ&quot;.AD_TOTAL_ADJUSTMENT) FROM QS36F.&quot;T16.CADJ&quot; AS &quot;T16.CADJ&quot;, QS36F.&quot;T16.CRDC&quot; AS &quot;T16.CRDC&quot;, QS36F.&quot;T16.CPRP&quot; AS &quot;T16.CPRP&quot;, QS36F.&quot;T16.GNAM&quot; AS &quot;T16.GNAM&quot;    
WHERE &quot;T16.CADJ&quot;.AD_TAXBILL_NO  = &quot;T16.CPRP&quot;.CP_TAXBILL_NO 
AND &quot;T16.CPRP&quot;.CP_PRIMARY_TAXPAYER = &quot;T16.GNAM&quot;.N_ID_NR 
AND &quot;T16.CADJ&quot;.AD_ADJUSTMENT_DATE &gt; 20091106 AND &quot;T16.CADJ&quot;.AD_ADJUSTMENT_DATE &lt; 20091205 AND &quot;T16.CADJ&quot;.AD_TOTAL_ADJUSTMENT &gt; -100.00 
and &quot;T16.CADJ&quot;.AD_REASON IN (&#039;C &#039;, &#039;R &#039;)    
Group by &quot;T16.GNAM&quot;.N_NAME, &quot;T16.GNAM&quot;.N_CITY;

This should give you the totals by person provided every name, city is unique - not likely.
Phil]]></description>
		<content:encoded><![CDATA[<p>SELECT  &#8220;T16.GNAM&#8221;.N_NAME, &#8220;T16.GNAM&#8221;.N_CITY,<br />
sum(&#8220;T16.CADJ&#8221;.AD_TOTAL_ADJUSTMENT) FROM QS36F.&#8221;T16.CADJ&#8221; AS &#8220;T16.CADJ&#8221;, QS36F.&#8221;T16.CRDC&#8221; AS &#8220;T16.CRDC&#8221;, QS36F.&#8221;T16.CPRP&#8221; AS &#8220;T16.CPRP&#8221;, QS36F.&#8221;T16.GNAM&#8221; AS &#8220;T16.GNAM&#8221;<br />
WHERE &#8220;T16.CADJ&#8221;.AD_TAXBILL_NO  = &#8220;T16.CPRP&#8221;.CP_TAXBILL_NO<br />
AND &#8220;T16.CPRP&#8221;.CP_PRIMARY_TAXPAYER = &#8220;T16.GNAM&#8221;.N_ID_NR<br />
AND &#8220;T16.CADJ&#8221;.AD_ADJUSTMENT_DATE &gt; 20091106 AND &#8220;T16.CADJ&#8221;.AD_ADJUSTMENT_DATE &lt; 20091205 AND &#8220;T16.CADJ&#8221;.AD_TOTAL_ADJUSTMENT &gt; -100.00<br />
and &#8220;T16.CADJ&#8221;.AD_REASON IN (&#8216;C &#8216;, &#8216;R &#8216;)<br />
Group by &#8220;T16.GNAM&#8221;.N_NAME, &#8220;T16.GNAM&#8221;.N_CITY;</p>
<p>This should give you the totals by person provided every name, city is unique &#8211; not likely.<br />
Phil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/duplicate-records-3/#comment-72099</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Thu, 31 Dec 2009 09:46:39 +0000</pubDate>
		<guid isPermaLink="false">#comment-72099</guid>
		<description><![CDATA[&lt;pre&gt;
SELECT Distinct
   &quot;T16.GNAM&quot;.N_NAME,
   &quot;T16.GNAM&quot;.N_CITY,
   &quot;T16.CADJ&quot;.AD_TOTAL_ADJUSTMENT,
   &quot;T16.CRDC&quot;.RD_COMMENT

  FROM

     QS36F.&quot;T16.CPRP&quot; AS &quot;T16.CPRP&quot;,
     QS36F.&quot;T16.GNAM&quot; AS &quot;T16.GNAM&quot;,
     QS36F.&quot;T16.CADJ&quot; AS &quot;T16.CADJ&quot;,
     QS36F.&quot;T16.CRDC&quot; AS &quot;T16.CRDC&quot;

  WHERE

     &quot;T16.CPRP&quot;.CP_PRIMARY_TAXPAYER = &quot;T16.GNAM&quot;.N_ID_NR AND
     &quot;T16.CPRP&quot;.CP_TAXBILL_NO = &quot;T16.CADJ&quot;.AD_TAXBILL_NO AND
     &quot;T16.CADJ&quot;.AD_TAXBILL_NO = &quot;T16.CRDC&quot;.RD_TAXBILL_NO AND
     &quot;T16.CADJ&quot;.AD_ADJUSTMENT_DATE &gt; 20091106 AND
     &quot;T16.CADJ&quot;.AD_ADJUSTMENT_DATE &lt; 20091205 AND
     &quot;T16.CADJ&quot;.AD_TOTAL_ADJUSTMENT &gt; -100.00 and
     &quot;T16.CADJ&quot;.AD_REASON IN (&#039;C &#039;, &#039;R &#039;)

  order BY &quot;T16.GNAM&quot;.N_NAME&lt;/pre&gt;Phil is probably on the right track. I poked around with the query to see if it could be made to read easier and perhaps make a little more sense. (And I see TAXBILL_NO provides the missing relationship from the previous question.)

You might consider re-ordering your query components closer to how I put them here. (I&#039;d be a little concerned about ordering purely by N_NAME since I can guarantee that two taxpayers at the same mailing street address can have the same name. It has happened to me personally with my father.)

As part of the re-ordering, I have T16.CRDC as the last file in the chain. That&#039;s just from coming to a similar conclusion to Phil&#039;s.

The query appears to be from a SQL client, possibly iSeries Navigator &#039;Run SQL Scripts&#039;. If you are intending to print a report, you might use this as the basis for a QM query. It&#039;s been a while, but I think the QM form could be adapted to print only the first line of the &quot;unique&quot; values from the first three files while printing each comment on subsequent lines. It would at least make the &#039;duplicates&#039; read sensibly.

Tom]]></description>
		<content:encoded><![CDATA[<pre>
SELECT Distinct
   "T16.GNAM".N_NAME,
   "T16.GNAM".N_CITY,
   "T16.CADJ".AD_TOTAL_ADJUSTMENT,
   "T16.CRDC".RD_COMMENT

  FROM

     QS36F."T16.CPRP" AS "T16.CPRP",
     QS36F."T16.GNAM" AS "T16.GNAM",
     QS36F."T16.CADJ" AS "T16.CADJ",
     QS36F."T16.CRDC" AS "T16.CRDC"

  WHERE

     "T16.CPRP".CP_PRIMARY_TAXPAYER = "T16.GNAM".N_ID_NR AND
     "T16.CPRP".CP_TAXBILL_NO = "T16.CADJ".AD_TAXBILL_NO AND
     "T16.CADJ".AD_TAXBILL_NO = "T16.CRDC".RD_TAXBILL_NO AND
     "T16.CADJ".AD_ADJUSTMENT_DATE &gt; 20091106 AND
     "T16.CADJ".AD_ADJUSTMENT_DATE &lt; 20091205 AND
     "T16.CADJ".AD_TOTAL_ADJUSTMENT &gt; -100.00 and
     "T16.CADJ".AD_REASON IN ('C ', 'R ')

  order BY "T16.GNAM".N_NAME</pre>
<p>Phil is probably on the right track. I poked around with the query to see if it could be made to read easier and perhaps make a little more sense. (And I see TAXBILL_NO provides the missing relationship from the previous question.)</p>
<p>You might consider re-ordering your query components closer to how I put them here. (I&#8217;d be a little concerned about ordering purely by N_NAME since I can guarantee that two taxpayers at the same mailing street address can have the same name. It has happened to me personally with my father.)</p>
<p>As part of the re-ordering, I have T16.CRDC as the last file in the chain. That&#8217;s just from coming to a similar conclusion to Phil&#8217;s.</p>
<p>The query appears to be from a SQL client, possibly iSeries Navigator &#8216;Run SQL Scripts&#8217;. If you are intending to print a report, you might use this as the basis for a QM query. It&#8217;s been a while, but I think the QM form could be adapted to print only the first line of the &#8220;unique&#8221; values from the first three files while printing each comment on subsequent lines. It would at least make the &#8216;duplicates&#8217; read sensibly.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/8 queries in 0.102 seconds using memcached
Object Caching 339/340 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-21 09:38:17 -->