<!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.4923.2500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff size=2><SPAN
class=476590313-23072003>Ervin,</SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff size=2><SPAN
class=476590313-23072003></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff size=2><SPAN
class=476590313-23072003>How about.</SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff size=2><SPAN
class=476590313-23072003></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff size=2>SELECT
Customer.CustID,</FONT></SPAN></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><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=782273911-23072003><SPAN class=476590313-23072003><FONT
face=Arial color=#0000ff size=2>Scott</FONT></SPAN></SPAN></DIV></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Ervin Brindza
[mailto:viner@eunet.yu]<BR><B>Sent:</B> Wednesday, July 23, 2003 8:57
AM<BR><B>To:</B> Access Developers discussion and problem
solving<BR><B>Subject:</B> Re: [AccessD] SQL: Sum from the third
table<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=scott.marcus@ae.ge.com href="mailto:scott.marcus@ae.ge.com">Marcus,
Scott (GEAE, Contractor)</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=accessd@databaseadvisors.com
href="mailto:accessd@databaseadvisors.com">'Access Developers discussion and
problem solving'</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> 23 July, 2003 1:41 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [AccessD] SQL: Sum from
the third table</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff
size=2>Ervin,</FONT></SPAN></DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff
size=2>SELECT Customer.CustID,</FONT></SPAN></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>
Sum(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><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff
size=2>Hope this helps.</FONT></SPAN></DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=782273911-23072003><FONT face=Arial color=#0000ff
size=2>Scott</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2></FONT> </DIV>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma><FONT
size=2>Sorry, but the same. E.g. if there are 1 order for the customer,
with e.g. 3 items, the field <FONT face=Arial>UkVred contain 3
times the ValAmount. It's weird?</FONT></FONT></FONT></DIV>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Arial
size=2>Thanks,</FONT></DIV>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Arial
size=2>
Ervin</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>