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!

Trouble grouping query results 1

Status
Not open for further replies.

mcf14

Programmer
May 6, 2004
4
0
0
US
I have a query with multiple joins that is giving me trouble when trying to group the output in cf. I cannot group the result set correctly. A test can have multiple test engineers and mutliple components involved and the components can have multiple operators. In the example recordset below, all of the fields consist of primary key values obtained from joins... I think my query is ok... I just need help grouping the results into an html table. So below, I've gotten all of the test engineers, components and operators involved in test number 1:

Query order by clause:
Order by testnum, testengineernum, testcomponentnum, testoperatornum

testnum testengineernum testcomponentnum testoperatornum
1 25 50 190
1 25 50 191
1 25 51 177
1 50 50 190
1 50 50 191
1 50 51 177
2 15 50 65
2 15 60 75
2 30 50 65
2 30 60 75

As you can see the components and operators are repeated for each test engineer in order to get all possibilities of everything involved in this test.

So I need to loop through each specified testnum (specified in multiselect control) and get all occurrences of test engineers, components, and operators involved in that test. The problem is the records are repeating (specifically on testcomponentnum), even when I nest cfoutput groups. Any idea how I can get the results to display like this below?

testnum: 1
testengineers:25, 50
testcomponents-testoperators:
50- 190, 191
51- 177

testnum: 2
testengineers:15, 30
testcomponents-testoperators:
50- 65
60- 75

This is how my code is displaying them, it's repeating on testcomponentnum, eveything's fine other than that:

testnum: 1
testengineers:25, 50
testcomponents-testoperators:
50- 190, 191
51- 177
50- 190, 191
51- 177

There's gotta be something easy I'm missing... surely this can be done. Can someone please help? I can attach my code if needed. Thanks!!!
 
I have found the solution to this problem in case anyone in the future runs into the same issue. I found the solution at I used the strategy from this web page to basically trick cf into allowing me to nest cfoutputs by including a template consisting of another query.
 
There ya go, that's how ya do it.

I gave you a star because when you found the solution, you came back and gave the answer to other people that might need it.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top