I have an unsorted dataset (a TMSQuery from Devart) that I cannot sort using ORDER BY because I manipulate the records after opening the query so the order given by "ORDER BY" is lost.
I don't want to rewrite the whole logic so I should find a way to sort a dataset.
I can Assign the dataset to a TMemDataSet (TMemDataSet is a DevArt class) descendant (TVirtualTable from Devart), but after this how do I sort (I need to sort by a date field)?
I read this question but it doesn't relly contain the answer I am looking for.
Using IndexFieldNames
I solved the problem, it was what I waslooking for. Directly from the TMSQuery
component:
MSQuery1.IndexFieldNames := 'EXECUTION_DATE'; //this does the job