Sorting an string as an int

Posts   
 
    
banusi
User
Posts: 43
Joined: 08-Jul-2006
# Posted on: 28-Jan-2010 13:09:10   

Hey

I have two tables, which I have joined by using a Typed List.

I use the Typed List as a data source to a combo box. My problem is that the data I wan't to show is a varchar in the database, but I wan't it to be sorted as an int in the combo box, because the data is numeric.

I can't change the datatype for the field in the database for reasons not relevant here.

So how can I make a order by cast(field as int) in llblgen.

I use 2.5 latest version.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 28-Jan-2010 22:04:36   

You can use a DBFunctionCall in a sort clause - please see the documentation here

Matt

banusi
User
Posts: 43
Joined: 08-Jul-2006
# Posted on: 29-Jan-2010 07:49:40   

Thanks. I will try that.