You are not logged in.
Pages: 1
It worked very well. Thank you!
I resolved passing this function to the Sort:
function OrderBy(const A, B): Integer;
function SortDateTime(const A, B): Integer;
begin
if TDateTime(A) < TDateTime(B) then
Result := -1
else
if TDateTime(A) > TDateTime(B) then
Result := 1
else
Result := 0;
end;
begin
Result := SortDynArrayInteger(TRec(A).USER_ID, TRec(B).CUSER_ID);
if Result = 0 then
begin
Result := SortDynArrayInteger(TRec(A).PRIORITY_ID, TRec(B).PRIORITY_ID);
if Result = 0 then
Result := SortDateTime(TRec(A).DATEINI, TRec(B).DATEINI);
end;
end;
For more than one column/field?
Like this: "ORDER BY NAME, PRIORITY, DATEINI ASC"
I was able to do only with one column
I bring some records from the database with a specific sort order and I put it in a record type vector. I need to add more items to this vector by keeping the initial ordering, however the records that are added are left at the end of the vector.
I want to know if there is any way to reorder this vector in the same way as it does in SQL ORDER BY.
(Sorry for my English)
Pages: 1