Rule one of data comparisons: always store numeric values in numeric fields.
When you compare two strings, it uses a string comparison, not a numeric one. This means each character is inspected one by one to see which is "higher" than the other. So a string comparison will be ordered as:
"1"
"10"
"11"
...
"2"
"20"
...
and so forth.
Change your database. Store numbers in numeric fields, and dates in date based field. Only ever store string values in string fields or you will get loads of awkward, annoying errors which are hard to code round - and completely unnecessary.