 




<?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: Embedded SQL using SUM or some other method to total up qty and display 1 unique record</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/embedded-sql-using-sum-or-some-other-method-to-total-up-qty-and-display-1-unique-record/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/embedded-sql-using-sum-or-some-other-method-to-total-up-qty-and-display-1-unique-record/</link>
	<description></description>
	<lastBuildDate>Sat, 25 May 2013 17:28:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/embedded-sql-using-sum-or-some-other-method-to-total-up-qty-and-display-1-unique-record/#comment-93129</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Fri, 10 Jun 2011 22:02:23 +0000</pubDate>
		<guid isPermaLink="false">#comment-93129</guid>
		<description><![CDATA[&lt;i&gt;When I insert my * for ALL...&lt;/i&gt;

When I first read that, I thought it referred to the asterisk in &quot;count(*)&quot;.

So, the statement in the comment isn&#039;t the one that throws the error?

Most likely, Phil&#039;s comment is getting close to the problem. Show us the statement that actually throws an error (and show us the error). It ought to be possible to describe in terms of the statement why the error appears. That should clarify how to avoid it in the future.

Tom]]></description>
		<content:encoded><![CDATA[<p><i>When I insert my * for ALL&#8230;</i></p>
<p>When I first read that, I thought it referred to the asterisk in &#8220;count(*)&#8221;.</p>
<p>So, the statement in the comment isn&#8217;t the one that throws the error?</p>
<p>Most likely, Phil&#8217;s comment is getting close to the problem. Show us the statement that actually throws an error (and show us the error). It ought to be possible to describe in terms of the statement why the error appears. That should clarify how to avoid it in the future.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/embedded-sql-using-sum-or-some-other-method-to-total-up-qty-and-display-1-unique-record/#comment-93117</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Fri, 10 Jun 2011 10:52:31 +0000</pubDate>
		<guid isPermaLink="false">#comment-93117</guid>
		<description><![CDATA[Every field that you include in the select will need to be in the Group By clause except the count and sum.  

You will get a count and total for each distinct set of the 8 fields.

I don&#039;t think that&#039;s what you want but that&#039;s what you asked for.

Since you will be getting back multiple rows, the embedded code will need a cursor.
Phil]]></description>
		<content:encoded><![CDATA[<p>Every field that you include in the select will need to be in the Group By clause except the count and sum.  </p>
<p>You will get a count and total for each distinct set of the 8 fields.</p>
<p>I don&#8217;t think that&#8217;s what you want but that&#8217;s what you asked for.</p>
<p>Since you will be getting back multiple rows, the embedded code will need a cursor.<br />
Phil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/embedded-sql-using-sum-or-some-other-method-to-total-up-qty-and-display-1-unique-record/#comment-93105</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Thu, 09 Jun 2011 20:25:32 +0000</pubDate>
		<guid isPermaLink="false">#comment-93105</guid>
		<description><![CDATA[&lt;i&gt;I stil get an error.&lt;/i&gt;

Error? What error? What is the message identifier, or at least the text?

Tom]]></description>
		<content:encoded><![CDATA[<p><i>I stil get an error.</i></p>
<p>Error? What error? What is the message identifier, or at least the text?</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dobie</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/embedded-sql-using-sum-or-some-other-method-to-total-up-qty-and-display-1-unique-record/#comment-93098</link>
		<dc:creator>dobie</dc:creator>
		<pubDate>Thu, 09 Jun 2011 16:01:18 +0000</pubDate>
		<guid isPermaLink="false">#comment-93098</guid>
		<description><![CDATA[ok , Ive got this much to work, but I need to select ALL fields in the file.  Or at least a select 8 fields that I need.    When I insert my * for ALL, I get an error, when I try to select the fields I need thru STRQRY, I stil get an error. 
&lt;pre&gt;                                                           
SELECT acsr2, count(*) as count, sum(shqt) as total FROM   
MERTAS/SGBCSHPF GROUP BY acsr2&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>ok , Ive got this much to work, but I need to select ALL fields in the file.  Or at least a select 8 fields that I need.    When I insert my * for ALL, I get an error, when I try to select the fields I need thru STRQRY, I stil get an error. </p>
<pre>                                                           
SELECT acsr2, count(*) as count, sum(shqt) as total FROM   
MERTAS/SGBCSHPF GROUP BY acsr2</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: dobie</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/embedded-sql-using-sum-or-some-other-method-to-total-up-qty-and-display-1-unique-record/#comment-93079</link>
		<dc:creator>dobie</dc:creator>
		<pubDate>Thu, 09 Jun 2011 11:37:53 +0000</pubDate>
		<guid isPermaLink="false">#comment-93079</guid>
		<description><![CDATA[Here is the Sample Data again:
CUCD                SCSR2     ACSR2     SHDT     SHQT
AM                        49             166         20110509         1
AM                        50              165        20110510          1
AM                        51              165        20110510           1
AM                        52               165       20110510           1
&lt;pre&gt;
Here is the sample of the partial select statement:
0113.02  * loaded racks    not shipped .............                      
0113.04 D Sel3            s            100a   inz(&#039;WHERE cucd = &#039;&#039;AM&#039;&#039; -  
0113.05 d                                     and shnm = &#039;&#039;     &#039;&#039; -      
0113.06 d                                     ORDER BY acsr2&#039;)            
0113.07                                                                   

This is what I want displayed:
MASTER SER#                               ASM COUNT                           SHIP DATE
165                                                          3                                          20110510&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Here is the Sample Data again:<br />
CUCD                SCSR2     ACSR2     SHDT     SHQT<br />
AM                        49             166         20110509         1<br />
AM                        50              165        20110510          1<br />
AM                        51              165        20110510           1<br />
AM                        52               165       20110510           1</p>
<pre>
Here is the sample of the partial select statement:
0113.02  * loaded racks    not shipped .............                      
0113.04 D Sel3            s            100a   inz('WHERE cucd = ''AM'' -  
0113.05 d                                     and shnm = ''     '' -      
0113.06 d                                     ORDER BY acsr2')            
0113.07                                                                   

This is what I want displayed:
MASTER SER#                               ASM COUNT                           SHIP DATE
165                                                          3                                          20110510</pre>
]]></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 6/8 queries in 0.011 seconds using memcached
Object Caching 325/326 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-25 21:39:37 -->