S
sdg8481
hi,
I have a very annoying problem that i can't seem to solve, so i was
wondering if any one can help.
Basically, i have a table with 139,084 rows, this table is made contains 11
rows each per zipcode, each row contains a zipcode, a place name, a distance
value (from zipcode to place name) and a population for that zipcode. For
each zipcode I need to find the row associated with shortest distance and
return that row only, hence in the end only be left with 12,644 unique rows
(139,084/11).
The way i have approached this is by making a make table query based on the
original table which sorts the data by Zipcode (asc) and then by Distance
(asc).
Then using a second query, i query this table, setting the criteria to
'First' on all the fields except the zipcode (and obviously the distance
field). On the face of it this appears to work and by eye it seems to work,
and i get the first one back for each zipcode, which i then sum the
populations.
HOWEVER, for some reason i get different results each time i run the set of
queries (or macro) only very slight but different everytime, I've tried and
looked at everything but this one has me beat.
Can anyone suggest any reasons or potential new approaches i can use !!
thanks very much, i'm just about to pull the last hair out my head.
S
I have a very annoying problem that i can't seem to solve, so i was
wondering if any one can help.
Basically, i have a table with 139,084 rows, this table is made contains 11
rows each per zipcode, each row contains a zipcode, a place name, a distance
value (from zipcode to place name) and a population for that zipcode. For
each zipcode I need to find the row associated with shortest distance and
return that row only, hence in the end only be left with 12,644 unique rows
(139,084/11).
The way i have approached this is by making a make table query based on the
original table which sorts the data by Zipcode (asc) and then by Distance
(asc).
Then using a second query, i query this table, setting the criteria to
'First' on all the fields except the zipcode (and obviously the distance
field). On the face of it this appears to work and by eye it seems to work,
and i get the first one back for each zipcode, which i then sum the
populations.
HOWEVER, for some reason i get different results each time i run the set of
queries (or macro) only very slight but different everytime, I've tried and
looked at everything but this one has me beat.
Can anyone suggest any reasons or potential new approaches i can use !!
thanks very much, i'm just about to pull the last hair out my head.
S