I have a TListview with 4 columns (which are all strings of course) however, I store data in them as such:
Caption
: any string
If you have two strings that contain integers and you wish to compare as integers then convert them from text to integer, and compare numerically.
function CompareTextAsInteger(const s1, s2: string): Integer;
begin
Result := CompareValue(StrToInt(s1), StrToInt(s2));
end;
And similarly for dates. Convert them from text to numeric values, for example TDateTime
values. And then compare numerically.
function CompareTextAsDateTime(const s1, s2: string): Integer;
begin
Result := CompareDateTime(StrToDateTime(s1), StrToDateTime(s2));
end;
Exactly how you implement this latter function depends on how you want to convert from text to numeric representation of date/time.