I read your query calc logic as follows:
If SortType = Ascending and SortColumn = 2, return a decimal value.
If SortType = Ascending and SortColumn <> 2, return an integer.
If SortType <> Ascending, return a string.
What is the source of your surprise?
If SortType = Ascending and SortColumn = 2, return a decimal value.
If SortType = Ascending and SortColumn <> 2, return an integer.
If SortType <> Ascending, return a string.
What is the source of your surprise?