<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Top 3 query returns only one record</TITLE>
<META content="MSHTML 6.00.2722.900" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=707453820-13052003>That
should do it. You're subquery was only going to give you the last three
dates of the entire table. You need the last three dates PER
well_label.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=707453820-13052003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=707453820-13052003>Drew</SPAN></FONT></DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Kaup, Chester A
[mailto:kaupca@chevrontexaco.com]<BR><B>Sent:</B> Tuesday, May 13, 2003 1:46
PM<BR><B>To:</B> ACCESSD@databaseadvisors.com<BR><B>Subject:</B> [AccessD] Top
3 query returns only one record<BR><BR></FONT></DIV><!-- Converted from text/rtf format -->
<P><FONT face=Arial size=2>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</FONT></P>
<P><FONT face=Arial size=2>SELECT TEST_DATE, FIELD_CODE, SAP_BORE_COMP_NUMBER,
WELL_LABEL, GAS_VOL, OIL_VOL, WATER_VOL</FONT> <BR><FONT face=Arial
size=2>FROM [TBL T15 WELL TESTS]</FONT> <SPAN class=707453820-13052003><FONT
face=Arial color=#0000ff size=2>[Drew Wutka] AS
T1 </FONT></SPAN><BR><FONT face=Arial size=2>WHERE TEST_DATE IN</FONT>
<BR><FONT face=Arial size=2>(SELECT TOP 3 TEST_DATE</FONT> <BR><FONT
face=Arial size=2>FROM [TBL T15 WELL TESTS]</FONT> <BR><SPAN
class=707453820-13052003><FONT face=Arial color=#0000ff size=2>[Drew
Wutka] WHERE WELL_LABEL=T1.WELL_LABEL</FONT></SPAN><SPAN
class=707453820-13052003> </SPAN><BR><FONT face=Arial size=2>ORDER BY
TEST_DATE DESC)</FONT> <BR><FONT face=Arial size=2>ORDER BY WELL_LABEL ASC,
TEST_DATE DESC;</FONT> </P>
<P><FONT face="Times New Roman" size=1>No trees were killed in the sending of
this message. However a large number of electrons were terribly
inconvenienced.</FONT><BR></P><BR></BLOCKQUOTE></BODY></HTML>