'Trim' values in a totals query

  • Thread starter Thread starter Kevin Beck via AccessMonster.com
  • Start date Start date
K

Kevin Beck via AccessMonster.com

I have a ralatively straightforward query that returns the minumum and
maximum cataloging numbers grouped by year. To weed out typos I want to
return a trimmed value, that is, removing 3 - 5 of the highest and lowest
values in the list.

Does anyone know how this can be done.
SQL:

SELECT Min([tblInterment Cards].IntrNbr) AS MinOfIntrNbr, Max([tblInterment
Cards].IntrNbr) AS MaxOfIntrNbr, [tblInterment Cards].IntrYr
FROM [tblInterment Cards]
GROUP BY [tblInterment Cards].IntrYr
HAVING (((Min([tblInterment Cards].IntrNbr))<>0) AND ((Max([tblInterment
Cards].IntrNbr))<>0) AND (([tblInterment Cards].IntrYr)>1887))
ORDER BY [tblInterment Cards].IntrYr;

Any and all help appreciated,

Kevin
 
If your raw data looked like the following,
tblInterment Cards:
IntrNbr IntrYr
1 1885
2 1885
3 1885
1 1890
2 1890
3 1890
1 1891
1 1892

it would return:

MinOfIntrNbr MaxOfIntrNbr IntrYr
1 3 1890
1 1 1891
1 1 1892

....based on the query supplied.

I guess if you could give me a better understanding of the raw data, I could
get a feel for what you're trying to achieve.
 
Thanks,

I have interment numbers by year something like

MinIntrYr MaxIntrNbr Year
12569 12899 1926
12900 13877 1927
13878 15698 1928
15699 16288 1929

where essentially there are between 300 and 1200 'interments' in a given year.
I am trying to get the totals query to give me a breakdown of which interment
numbers were in which year.

The trouble I am having is that we are dealing with a lot of typos from the
data entry side, so the totals query looks something like this

minIntYr MaxIntrNbr Year
556 189989 1926
12.900 138778 1927
0 1555688 1928
55 162887.2 1929

So, what I am wondering is if I can have the totals query "knock off" the
bottom- and top-most values, giving me a trimed minimum and a trimmed maximum
that would more closely represent what the data ultimately should look like.
I hope this makes more sense.

Thank you for your response!

Kevin
 

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

Back
Top