<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2800.1226" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=760453011-03092003><FONT face=Arial color=#0000ff size=2>Change
your sort order in the report to SumOfAmount desc, Customer.Name to get the
result you desire.</FONT></SPAN></DIV>
<DIV><SPAN class=760453011-03092003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=760453011-03092003>
<DIV align=left><FONT face=Arial size=2>Doris Manning</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Database Administrator</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Hargrove Inc.</FONT></DIV>
<DIV align=left><FONT face=Arial size=2><A
href="http://www.hargroveinc.com/">www.hargroveinc.com</A></FONT></DIV></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
accessd-bounces@databaseadvisors.com
[mailto:accessd-bounces@databaseadvisors.com] <B>On Behalf Of </B>Ervin
Brindza<BR><B>Sent:</B> Wednesday, September 03, 2003 7:26 AM<BR><B>To:</B>
AccessD@databaseadvisors.com<BR><B>Subject:</B> [AccessD] Sort order in
report<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2>I need a little push to finish my report. I
have 3 tables: Customer(Id, Name), Order(Id - the customer's Id, KeyFld -
AutoNumber field, linked to the table OrderDet), OrderDet(KeyFld, Id - ordered
item's Id, ItemName, Amount)</FONT></DIV>
<DIV><FONT face=Arial size=2>The record source of the report is:</FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=2>
<P>SELECT CUSTOMER.Id, CUSTOMER.Name, ORDERDET.ItemName, ORDERDET.Id,
Sum(ORDERDET.Amount) AS SumOfAmount</P>
<P>FROM CUSTOMER INNER JOIN (ORDER INNER JOIN ORDERDET ON ORDER. KeyFld =
ORDERDET.KeyFld) ON CUSTOMER.Id = ORDER.Id</P>
<P>GROUP BY CUSTOMER.Id, CUSTOMER. CustName, ORDERDET.ItemName,
ORDERDET.Id;</P>
<P>And I want to list the customers along with their ordered items, but in
descending order on the sum of amount they ordered(the ordered items are
listed desc and that is ok). In the report's View/Sorting and grouping I
put CUSTOMER.Name and SumOfAmount desc and I get customers listed by their
name :(</P>
<P>So, my report looks like:</P>
<P>1. Ervin Brindza</P>
<P> 1. orange 100</P>
<P> 2. apple 80</P>
<P>2. Mike Thompson</P>
<P> 1. plum 155</P>
<P> 1. orange 40</P>
<P>but I want Mike Thompson to be listed first(he ordered 195) and after came
Ervin Brindza(who ordered 180)</P>
<P>Hope I was clear enough.</P>
<DIV><FONT face=Arial size=2><FONT size=3>
<P>Can anyone shed any light</FONT> please?</P>
<P>TIA,</P>
<P>
Ervin</FONT></P></DIV></FONT></FONT></DIV></BLOCKQUOTE></BODY></HTML>