The Column Netto F. is sorted (perfectly sorted)… without code. And so can be the other Column (Lordo F.).
I used “√” instead of True; I do not recall what accountant use to say “Paid !”… If the Field holds False, nothing appears in that Cell. (this design can evolve).
May I suggest using a Tick String as a Constant as it appears properly in macOS/Windows/Linux plus Web and iOS, and looks better than a square root symbol:
dim StringaDiOrdinamento as string
StringaDiOrdinamento="TotaleScadenza"
rows = db.SelectSQL("SELECT * FROM Scadenziario order by "+StringaDiOrdinamento)
Good morning TIM, I don’t remember where CREATE TABLE is, however Scadenziario is a table with a series of data, I tried to sort the table based on the Total (€) column on the ListBox, which in the MsAccess database table is called TotaleScadenza and is of the Currency type. Sorting the table with the commands written above, it is not sorted well… in fact 103.70 is ordered, then there is 1073.60, then 109.80 …etc…etc…
I managed to do the good sorting, writing the code inside RowComparision and everything is sorted perfectly, but Emile had suggested to me that simply by setting an ORDER BY in the query, I could get the same result with less code … but the sorting doesn’t work and I can’t explain why.
Is there a problem sorting the data with …“Scadenziario order by TotaleSacdenza” ?? Is it the type of data that is annoying?
I tried to load the data as suggested, but the sorting by clicking on the column concerned, however, gives me the wrong one.
The second table, however, with the sorting algorithm in RowCompariosion, works.