View previous topic :: View next topic
|
Author |
Message |
prasannahcp
New User
Joined: 16 May 2005 Posts: 17 Location: Bangalore
|
|
|
|
I want to sort the record based on the record type.
For example, I have a file having the record type at the beginning of each record.
Recordtype Field1 Field2 Field3
CS010 ....... ....... .......
CS020 ....... ....... .......
CS030 ....... ....... .......
CS040 ....... ....... .......
CS050 ....... ....... .......
For records type CS050, sort the records based on Field1, Field2 and Field3
For all other records types sort the records based on Field1 and Field2.
Is there a way to sort based on the record types.
Any help would be appreciated.
Thanks,
Prasanna |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
1. In this forum any sample must be presented in this way (to be polite to potential readers):
Code: |
Recordtype Field1 Field2 Field3
CS010 ....... ....... .......
CS020 ....... ....... .......
CS030 ....... ....... .......
CS040 ....... ....... .......
CS050 ....... ....... ....... |
2. What the harm would be if ALL records were sorted by all three fields?
No problem is expected usually.
In this case no need to create an issue where there is none.
3. If there is really a reason for that, the solution can be done:
- create TempField3 as Field3 for CS050, and blanks for all other types
- SORT by Field1,Field2,TempField3,EQUALS
- truncate TempField3 |
|
Back to top |
|
|
|