<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2719.2200" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=522215618-13052003><FONT color=#0000ff
size=2>Chester,</FONT></SPAN></DIV>
<DIV><SPAN class=522215618-13052003><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=522215618-13052003><FONT color=#0000ff size=2>Check the thread
"SQL in-line subquery" for Dave Sharpe's response of last Wednesday. He
had a link to an article that should answer your question about your
subquery.</FONT></SPAN></DIV>
<DIV> </DIV><!-- Converted from text/rtf format -->
<P><SPAN lang=en-us><B><FONT color=#0000ff>Charles Wortz</FONT></B></SPAN>
<BR><SPAN lang=en-us><FONT color=#0000ff>Software Development
Division</FONT></SPAN> <BR><SPAN lang=en-us><FONT color=#0000ff>Texas Education
Agency</FONT></SPAN> <BR><SPAN lang=en-us><FONT color=#0000ff>1701 N. Congress
Ave</FONT></SPAN> <BR><SPAN lang=en-us><FONT color=#0000ff>Austin, TX
78701-1494</FONT></SPAN> <BR><SPAN lang=en-us><FONT
color=#0000ff>512-463-9493</FONT></SPAN> <BR><SPAN lang=en-us><FONT
color=#0000ff>CWortz@tea.state.tx.us</FONT></SPAN> </P>
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us 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 2003 May 13
13:46<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> <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><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></BODY></HTML>