<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6389.0">
<TITLE>Subquery returns to many or no records</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">When I try to run the following query access displays the error message subquery returned multiple records </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">SELECT DISTINCT T9DATA_CATDAILYPRODM.ORAACTDT, T9DATA_CATDAILYPRODM.BOPD</FONT>
<BR><FONT SIZE=2 FACE="Arial">FROM T9DATA_CATDAILYPRODM</FONT>
<BR><FONT SIZE=2 FACE="Arial">WHERE (((T9DATA_CATDAILYPRODM.ORAACTDT)=#10/1/2003#) AND ((T9DATA_CATDAILYPRODM.BOPD</FONT><FONT COLOR="#FF0000" SIZE=2 FACE="Arial">)=(SELECT BOPD from T9DATA_CATDAILYPRODM where USRFLD1 ="Y"))</FONT> <FONT SIZE=2 FACE="Arial">AND ((T9DATA_CATDAILYPRODM.AREADESC)="TEXAS GAS") AND ((T9DATA_CATDAILYPRODM.SUPVNM)="TGF FORT STOCKTON" Or (T9DATA_CATDAILYPRODM.SUPVNM)="TGF KERMIT"));</FONT></P>
<P><FONT SIZE=2 FACE="Arial">If I change the query to the following no records are returned</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">SELECT DISTINCT T9DATA_CATDAILYPRODM.ORAACTDT, T9DATA_CATDAILYPRODM.BOPD</FONT>
<BR><FONT SIZE=2 FACE="Arial">FROM T9DATA_CATDAILYPRODM</FONT>
<BR><FONT SIZE=2 FACE="Arial">WHERE (((T9DATA_CATDAILYPRODM.ORAACTDT)=#10/1/2003#) AND </FONT><FONT COLOR="#FF0000" SIZE=2 FACE="Arial">((T9DATA_CATDAILYPRODM.BOPD)=(SELECT SUM(BOPD) from T9DATA_CATDAILYPRODM where USRFLD1 ="Y"))</FONT> <FONT SIZE=2 FACE="Arial">AND ((T9DATA_CATDAILYPRODM.AREADESC)="TEXAS GAS") AND ((T9DATA_CATDAILYPRODM.SUPVNM)="TGF FORT STOCKTON" Or (T9DATA_CATDAILYPRODM.SUPVNM)="TGF KERMIT"));</FONT></P>
<P><FONT SIZE=2 FACE="Arial">What am I missing here. There should be records returned. Thanks</FONT>
</P>
<P><FONT SIZE=1 FACE="Times New Roman">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>