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

Grouping of the nesting categories

Status
Not open for further replies.

vladk

Programmer
May 1, 2001
991
US
OK, there is a problem. A table, say Main, looks like shown below. The Ratio column can contain some numbers and if they are the same for particular field (the category) then I will need to group them and replace the field of the nesting category with some "99" code. If all the fields (lower category) of the upper containing category have the same ratio then the next field I would need to replace with it's "99" code so it will not be repeated more than once. The top category is ClassCD. The order of the nesting is as follows:

ClassCD{TerrNbr{AlphaCD{Coverage{RateGroup{Ratio}}}}}

In the example below, the ClassCD of 11382 has the same ratio, as such, the query result for this class code would be:

Ratio RateGroup Coverage AlphaCD TerrNbr ClassCD
1 99 999 M 99999 11382

If ClassCD of 11390 had the same ratio then ClassCD field would have 999999. If ratios are different then I need just show them as they are in query result set.


Thank you

vladk

Ratio RateGroup Coverage AlphaCD TerrNbr ClassCD
1 3 10 M 1 11382
1 7 20 M 1 11382
1 8 40 M 1 11382
1 3 10 M 2 11382
1 7 20 M 2 11382
1 8 40 M 2 11382
1 3 10 M 3 11382
1 7 20 M 3 11382
1 8 40 M 3 11382
1 3 10 M 4 11382
1 7 20 M 4 11382
1 8 40 M 4 11382
1 3 10 M 5 11382
1 7 20 M 5 11382
1 8 40 M 5 11382
1 3 10 M 6 11382
1 7 20 M 6 11382
1 8 40 M 6 11382
1 3 10 M 7 11382
1 7 20 M 7 11382
1 8 40 M 7 11382
1 3 10 M 8 11382
1 7 20 M 8 11382
1 8 40 M 8 11382
1 2 10 W 1 11390
1 2 20 W 1 11390
1.02 2 10 W 2 11390
1.02 2 20 W 2 11390
1.02 2 10 W 3 11390
1.02 2 20 W 3 11390
0.9 2 10 W 4 11390
0.9 2 20 W 4 11390
1 2 10 W 5 11390
1 2 20 W 5 11390
0.97 2 10 W 6 11390
0.97 2 20 W 6 11390
1.02 2 10 W 7 11390
1.02 2 20 W 7 11390
1 2 10 W 8 11390
1 2 20 W 8 11390

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top