[AccessD] Top 3 query returns only one record

Kaup, Chester A kaupca at chevrontexaco.com
Tue May 13 13:46:14 CDT 2003


The following query returns only one record per well_label rather than
the last 3 like I need. I don't see the problem-been looking at it to
long. Thanks

SELECT TEST_DATE, FIELD_CODE, SAP_BORE_COMP_NUMBER, WELL_LABEL, GAS_VOL,
OIL_VOL, WATER_VOL
FROM [TBL T15 WELL TESTS]
WHERE TEST_DATE IN
(SELECT TOP 3 TEST_DATE
FROM [TBL T15 WELL TESTS]
ORDER BY TEST_DATE DESC)
ORDER BY WELL_LABEL ASC, TEST_DATE DESC;

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



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030513/498727f7/attachment.html>


More information about the AccessD mailing list