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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS400 combineing results work query

Status
Not open for further replies.

CecilXavier

Technical User
Oct 2, 2007
104
US
I'm trying to get a query to list results, but combine and count them. Meaning if a result is "Virginia" and it pops up 4 times, it lists "Virginia" once with a count of 4 under it. This is what I'm getting.

State
0000001 Virginia
0000002 Virginia
0000003 Virginia
0000004 COUNT 3

What I would like to get is:
State
0000001 Virginia
0000002 COUNT 3

Anyone have any pointers?
 
what you want is summary info, not detail and summary,, then in your total line,, you want to specify not only count on the field you also, want oh say min, or avg. Since they are all the same,, you will get the desired results. I am assuming you are using the IBM QRY..It looks like you are..

 
Yes, ibm query.
ok, that is doing what I want, how do I tell it just summery?
 
I think I got it. It was under out type. Select summery only instead of detail. Yep, works. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top