Hi,
Isn't John Spencer's solution working?
Vanderghast, Access MVP
That doesn't really do it. Each station in ther database has a WMO number
(World Meteorological Organization) plus additional digit (mod).
If I sort by precip first I get the top 25% of all January's no matter
what
station. I need the top 25% of January's for EACH station.
Logically this is what I need:
SELECT Precip_Inches.wmo, Precip_Inches.mod, TOP 25 PERCENT
Precip_Inches.Jan
FROM Precip_Inches
ORDER B Precip_Inches.wmo, Precip_Inches.mod, Precip_Inches.Jan DESC;
Problem is that Access can't handle this logic.
If I put in the parameters to select a particular WMO and mod it works
fine
for that one station. But I want to do them all at one shot.
BTW, if there are any weather geeks here this is the data I'm working
with:
http://www.ncdc.noaa.gov/cgi-bin/res40.pl?page=ghcn.html
(You need to agree to the terms to get to it)
So I need to sort by WMO first, then display the top 25% for Jan for Each
WMO Number.
You need change your order by to:
ORDER BY Precip_Inches.Jan DESC, Precip_Inches.wmo
or remove the sort on Precip_Inches.wmo altogether.
--
Paul Overway
Logico Solutions, LLC
www.logico-solutions.com
I saw the option to select how many records you want but that doesn't
do
what I want. For example look at the SQL:
SELECT TOP 25 PERCENT Precip_Inches.wmo, Precip_Inches.[mod],
Precip_Inches.Jan
FROM Precip_Inches
ORDER BY Precip_Inches.wmo, Precip_Inches.Jan DESC;
I want the top 25 percent of Precip_Inches.Jan, not the first