I have the field receiptno, which is a varchar holding a numeric value, and want to sort this. Sorting as a string gives me the wrong ordering. I’d like to try sorting it as an integer. Is there anyway to converting to integer in the order by clause so I can sort by integer in the query itself.
I have the field receiptno , which is a varchar holding a numeric value,
Share
You can use
castorconvertto convert the field type:... ORDER BY CAST(receiptno AS INTEGER) ASCEdit sorry, fixed syntax