incrementing values in queries

J

JMSatMetro

Dear experts,

I have a query which produces a recordset with 3 fields that looks like this:

OTAZ2013 FacilityName PerTripTime
1 Metro Central 53.6
1 Troutdale 54.4
1 Metro South 70.3
1 WRI 83.59
1 Pride Recycling 86.48
1 Forest Grove 113.51
2 Troutdale 52.5
2 Metro Central 54.47
2 Metro South 68.4
2 WRI 83.69
2 Pride Recycling 86.58
2 Forest Grove 114.38
3 Troutdale 50.85
3 Metro Central 53.22
3 Metro South 66.08
3 WRI 80.41
3 Pride Recycling 83.31
3 Forest Grove 113.14

I need to add a fourth field [Rank] that assigns a value 1 through 6 for
each [OTAZ2013] value, such that a rank value =1 corresponds to the Minimum
[PerTripTime] for that OTAZ2013. So, my resulting table would look like:

OTAZ2013 FacilityName PerTripTime Rank
1 Metro Central 53.6 1
1 Troutdale 54.4 2
1 Metro South 70.3 3
1 WRI 83.59 4
1 Pride Recycling 86.48 5
1 Forest Grove 113.51 6
2 Troutdale 52.5 1
2 Metro Central 54.47 2
2 Metro South 68.4 3

Can anyone help me to compute the field [Rank]?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top