captainquigers
Programmer
How would I roll up records based upon which band a value lies in?
The data looks like this;
Field1 Field2
1 48.25
2 12.68
2 98.16
7 12.36
8 67.46
12 46.64
15 45.89
And I would like like the query to output;
Field1 Field2(sum) Field2(avg)
1-5 159.09 53.03
6-10 79.82 39.91
11-15 95.53 47.77
16+ 0 0
There are 30 bands that the value could fall into so a nested IF statement with a BETWEEN clause is way too big!
I also thought about using a lookup table, but as the value can be between -50,000.00 and 250,000.00 this table would also be too big.
Any help would be greatly apprecited.
Cheers,
Captain
The data looks like this;
Field1 Field2
1 48.25
2 12.68
2 98.16
7 12.36
8 67.46
12 46.64
15 45.89
And I would like like the query to output;
Field1 Field2(sum) Field2(avg)
1-5 159.09 53.03
6-10 79.82 39.91
11-15 95.53 47.77
16+ 0 0
There are 30 bands that the value could fall into so a nested IF statement with a BETWEEN clause is way too big!
I also thought about using a lookup table, but as the value can be between -50,000.00 and 250,000.00 this table would also be too big.
Any help would be greatly apprecited.
Cheers,
Captain