Sorting on numeric column

3 posts by 2 authors in: Forums > CMS Builder
Last Post: March 23, 2009   (RSS)

I have a column in a section that I've created which holds prices. If I use the orderBy attribute when getting records in the viewer code, it will order based on the string, not the number. So, 10.39 is less than 5.90 for example.

Is there a way around this, I can't see a way to define the column type as numeric, unless I just have to do that in the MySQL database directly?

Thanks,

Paul.

Re: [Dave] Sorting on numeric column

That's great, the MySQL column type is just what I need in future, but as I've already got a table full of data the Price+0 method will work for the current set-up, so thanks!