Reputation: 1645
newbie question here. How can I sort employee table by LEN(Firstname) Desc then by lastName asc?
Here is the code I have so far:
output to /usr2/appsrv/test/Test.txt.
def var dRow as char.
for each emp by emp.FirstName no-lock:
dRow = substitute ("&1,&2", emp.FirstName, emp.LastName).
put unformatted dRow skip.
end.
put unformatted dRow skip.
output close.
I am on version 11.3.3
Thank you
Upvotes: 0
Views: 225
Reputation: 14020
for each emp by length( emp.firstName ) descending by lastName:
display emp.firstName emp.lastName.
end.
Performance will stink if this is a large table.
Upvotes: 2