You need to add an order by clause to your SQL statement, and order by
company name.
--K
-----Original Message-----
From: Lisa Hamlin [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 28, 2000 11:39 AM
To: [EMAIL PROTECTED]
Subject: Sorting Query results
This is a multi-part message in MIME format.
------=_NextPart_000_0187_01C010FD.C35A9E00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
We have a customer who wants to take the results of a query and sort =
them by a specific column. The intial query did a UNION on several =
tables (one table for each month). The resulting output looked something =
like this:
COMPANY1
PRODUCT A - totals
PRODUCT B - totals
COMPANY2
PRODUCT C - totals
PRODUCT D - totals
COMPANY3
PRODUCT 3 - totals
COMPANY1
PRODUCT B - totals
The customer wants to re-sort so that all of COMPANY1's information is =
consecutive (for grand totals). How can this be done?
Thanks in advance,
Lisa
=20
------=_NextPart_000_0187_01C010FD.C35A9E00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>We have a customer who wants to take =
the results of=20
a query and sort them by a specific column. The intial query did a =
UNION on=20
several tables (one table for each month). The resulting output looked =
something=20
like this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>COMPANY1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> PRODUCT =
A -=20
totals</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> PRODUCT =
B -=20
totals</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>COMPANY2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> PRODUCT =
C -=20
totals</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> PRODUCT =
D -=20
totals</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> COMPANY3</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> PRODUCT =
3 -=20
totals</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>COMPANY1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> PRODUCT =
B -=20
totals</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>The customer wants to re-sort so that =
all of=20
COMPANY1's information is consecutive (for grand totals). How can this =
be=20
done?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Lisa</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
</FONT> </DIV></BODY></HTML>
------=_NextPart_000_0187_01C010FD.C35A9E00--
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.