Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Total by Product Column

Status
Not open for further replies.

netrusher

Technical User
Joined
Feb 13, 2005
Messages
952
Location
US
Below is the code that I have for a query. What I would
like to be able to do is somewhere in the query results
is show a total of Event Time for the Product Field.
Let's say there are 10 Fields for the same Product. I would
like to show a total of the Event_Times for that Product. I
would still like to see the 10 rows of information and then
a total. Any Suggestions?

Code:
SELECT TIME55.PRODUCT, TIME55.BUILD_ID, TIME55.PROCESS, TIME55.SOE_CODE, TIME55.EVENT_NUMB, TIME55.EVENT, TIME55.EVENT_TIME, TIME55.PRODUCT_DE
FROM TIME55
GROUP BY TIME55.PRODUCT, TIME55.BUILD_ID, TIME55.PROCESS, TIME55.SOE_CODE, TIME55.EVENT_NUMB, TIME55.EVENT, TIME55.EVENT_TIME, TIME55.PRODUCT_DE
HAVING (((TIME55.BUILD_ID)="l177"))
ORDER BY TIME55.PRODUCT, TIME55.PROCESS, TIME55.SOE_CODE, TIME55.EVENT_NUMB;
 



Hi

Notich that EVENT_TIME is not in the Groupb By clause...
Code:
SELECT
  TIME55.PRODUCT
, TIME55.BUILD_ID
, TIME55.PROCESS
, TIME55.SOE_CODE
, TIME55.EVENT_NUMB
, TIME55.EVENT[b]
, SUM(TIME55.EVENT_TIME)[/b]
, TIME55.PRODUCT_DE

FROM TIME55

GROUP BY
  TIME55.PRODUCT
, TIME55.BUILD_ID
, TIME55.PROCESS
, TIME55.SOE_CODE
, TIME55.EVENT_NUMB
, TIME55.EVENT
, TIME55.PRODUCT_DE

HAVING (((TIME55.BUILD_ID)="l177"))

ORDER BY
  TIME55.PRODUCT
, TIME55.PROCESS
, TIME55.SOE_CODE
, TIME55.EVENT_NUMB;


Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
Skip,

Thanks but that is not giving me a total total, it is giving me a total of each row which I get if I Group By the Event_Time Field. I am looking for a total of all the Rows for when the Product Changes.
 
Anybody still looking at this posting????
 





You want to same total value on multiple rows?

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top