  | | | Subject: Need help to create a query | Subject: Need help to create a query 2007-11-05 - By N?stor
Back I have a table with about 9 fields, and record ID field an agency name field and the # of gallons that a erson pledges to save: -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- |ID| agency| 5g | 8g | 10g | 12g | 15g | 18g | 20g | -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
Each of the gallon fields are either a 0 or the # of gallons for that column: |1 | Helix | 0 | 8 | 10 | 0 | 15 | 0 | 0 | |2 | corp | 5 | 8 | 0 | 12 | 15 | 18 | 20 | |3 | Helix | 5 | 8 | 10 | 0 | 15 | 0 | 20 | |4 | Helix | 5 | 8 | 10 | 0 | 15 | 0 | 0 | |5 | corp | 5 | 0 | 0 | 12 | 15 | 0 | 20 |
I need to be able to obtain the top 5 pledges per agency: | Helix |8g = 3|10g =3 |15g = 3 |5g = 2 |20g = 2 | | Corp |5g = 2 | 12g = 2 |15g = 2 | 20g = 2| 8g = 1|
Thanks,
Nestor :-)
|
|
 |