Sorting

Chris Kelleher

Administrator
Staff member
This is a silly one, but being new to progress I'll ask anyway. I have a for each, it hets me all my data, then I want to sort it, I use break by field1, by field2 by field3 by field4. I want field2 to be decending, while the others are ascending. this isn't as somple as following the field2 with a "D", is it?? I can't find anything in the reference manuals. Tanks in advance.


David L. Knowles
Database Administrator
Captive Plastics, Inc
Partners in Plastics Packaging
 
It's in the reference manual under "FOR" statement.

Syntax: [ BREAK ] [ BY expression [DESCENDING] ]

David Takle
Software Consultant
Find First Consultant, Inc.
 
David,

You can specify sort order with the DESCENDING keyword. (Which can be
abbreviated to DESC).

ie...

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
FOR EACH xyz NO-LOCK
BREAK BY fld1 DESC BY fld2 BY fld3:
/* whatever */
END.
[/code]

- Tris Hopkins
Flexalloy-Textron
 
Back
Top