[AccessD] Top Values Query

Kaup, Chester Chester_Kaup at kindermorgan.com
Wed Sep 29 08:59:46 CDT 2010


In the attached query I am attempting to get the top three dates for each PID in the dbo_DSS_Welltests table. I calculate I should be getting 3 records for each of 9 PIDs for a total of 27 records. I only get 7 records. 

SELECT TOP 3 dbo_DSS_Welltests.TestDate, dbo_DSS_Welltests.PID
FROM dbo_DSS_Welltests 
INNER JOIN ConfigMaster ON dbo_DSS_Welltests.PID = ConfigMaster.ChildPID
WHERE ((([Configmaster].[PID]) 
In ("PAT 225-10","PAT 225-8","PAT 225-11","PAT 225-3A")))
ORDER BY dbo_DSS_Welltests.TestDate DESC;

Chester Kaup
Engineering Technician
Kinder Morgan CO2 Company, LLP
Office (432) 688-3797
FAX (432) 688-3799

 
No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.





More information about the AccessD mailing list