I have a data source that looks like this:
Select
FieldA || FieldB as FieldC
from myTable
FieldA is a decimal(2). Some values in the table are one digit. Some values are two digits.
FieldB is a character
I then make a grid widget with this data source. In that grid widget, I have the FieldC column set up with CNX's built in sorting feature, which lets me click the header of the field in order to sort it in either ascending or descending order.
When I fire up my app and sort FieldC in ascending order, the values with a two-digit FieldA appear towards the top (in ascending order). Once those values are done, then the values with a one-digit FieldA are shown (also sorted in ascending order). The descending sort is the same, but in the opposite order.
For some reason, it is acting like there is a space in front of FieldA, and then sorting numbers before spaces, instead of sorting by the first character in the string.
I have a temporary workaround for this:
Select
digits(FieldA) || FieldB as FieldC
from myTable
This workaround sorts correctly, but it would be cool if I could sort correctly without leading zeroes.
Thank you!
Select
FieldA || FieldB as FieldC
from myTable
FieldA is a decimal(2). Some values in the table are one digit. Some values are two digits.
FieldB is a character
I then make a grid widget with this data source. In that grid widget, I have the FieldC column set up with CNX's built in sorting feature, which lets me click the header of the field in order to sort it in either ascending or descending order.
When I fire up my app and sort FieldC in ascending order, the values with a two-digit FieldA appear towards the top (in ascending order). Once those values are done, then the values with a one-digit FieldA are shown (also sorted in ascending order). The descending sort is the same, but in the opposite order.
For some reason, it is acting like there is a space in front of FieldA, and then sorting numbers before spaces, instead of sorting by the first character in the string.
I have a temporary workaround for this:
Select
digits(FieldA) || FieldB as FieldC
from myTable
This workaround sorts correctly, but it would be cool if I could sort correctly without leading zeroes.
Thank you!
Comment