<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff size=2>SELECT
Customer.CustID,</FONT></SPAN></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff
size=2> Customer.Name,</FONT></SPAN></DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff
size=2> <SPAN
class=476590313-23072003>First</SPAN>(Order.ValAmount) AS
UkVred,</FONT></SPAN></DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff
size=2>
Sum(OrderDet.Quantity) AS ukkol<BR>FROM (Customer INNER JOIN [Order] ON
Customer.CustID = Order.CustID)</FONT></SPAN></DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff
size=2> INNER JOIN
OrderDet ON Order.RedBROJ = OrderDet.RedBROJ<BR>GROUP BY Customer.CustID,
Customer.Name;</FONT></SPAN></DIV>
<DIV><SPAN class=782273911-23072003></SPAN><FONT face=Arial color=#0000ff
size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>Scott,</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>I'm very sorry, but the result isn'
appropriate for me.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>I want to list the customers from
the Customer table. The column UkVred have to sum the field ValAmount from the
Order table, and the last column have to sum the field Quantity for customers
orders. </FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>E.g.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>Customer(CustId, Name)</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>1 Scott</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>2 Ervin</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>Order(REDBROJ, CustId,
ValAmount)</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>1 1 10</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>2 1 15</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>3 2 100</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>OrderDet(REDBROJ,
Quantity)</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>1 10</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>1 20</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>2 30</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>2 40</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>2 50</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>3 60</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>3 70</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>3 80</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>And I want to get:</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>1 Scott 25 150 </FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>2 Ervin 100 210</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>But the <SPAN
class=476590313-23072003>First</SPAN>(Order.ValAmount) give
me:</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>
<DIV><FONT face=Arial color=#0000ff size=2>1 Scott 10(list the first ValAmount
instead to sum) 150 </FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>2 Ervin 100 160 </FONT></DIV>
<DIV>If I change the First function to Sum</DIV>
<DIV> <FONT face=Arial color=#0000ff size=2>1 Scott 125(5*25) 150 </FONT>
<DIV><FONT face=Arial color=#0000ff size=2>2 Ervin 100 160 </FONT></DIV>
<DIV>So, the quantity is ok, but the ValAmount isn't .</DIV>
<DIV>Hope I don't want something impossible :)</DIV>
<DIV>Maybe someone on the List have a good idea...</DIV>
<DIV>Thanks,</DIV>
<DIV><FONT color=#000000>
Ervin</FONT></DIV></DIV></FONT></DIV></DIV></BLOCKQUOTE></BODY></HTML>