convert

Danny Lewkin daniel.lewkin at cognosis.be
Fri Mar 28 08:39:52 CDT 2008


So there is no other way but changing te table structure?


Op 28-mrt-08, om 14:33 heeft Ivan Smahin het volgende geschreven:

> Hello Ivan,
>
> Friday, March 28, 2008, 3:31:07 PM, you wrote:
>
>> Hello Danny,
>
>> Friday, March 28, 2008, 2:57:13 PM, you wrote:
>
>>> Hi List,
>
>>> anyone knows if CONVERT works in valentina?
>>> I have a field 'levelname' and want to order on that, problem is,  
>>> that
>>> this is a varchar field and when i have records lke this :
>
>>> 1,2,3,4,5,6,7,8,9,10,11,12,...
>
>>> it sorts like : 1,10,11,12,13,...2,20,21,22,....
>
>>> which is normal because its an varchar field.
>
>>> So I tried to convert this varchar field to an integer using :
>
>>> SELECT CONVERT(INTEGER, LEVELNAME) AS INTLEVEL FROM TBL_SCORELEVELS
>
>>> but i keep getting error :
>
>>> 13:47:54: Error: Kernel error: 0x71000. line 1:15: unexpected token:
>>> CONVERT
>
>> CREATE TABLE t1 ( f1 Varchar(20) );
>> INSERT INTO t1 VALUES (10);
>> INSERT INTO t1 VALUES (1);
>> INSERT INTO t1 VALUES (2);
>> select * from t2 order by f1;
>> --
>> 1
>> 10
>> 2
>
>> ALTER TABLE t1 MODIFY f2 LONG;
>
>> select * from t2 order by f1;
>> --
>> 1
>> 2
>> 10
>
> Sorry
>
> ALTER TABLE t1 MODIFY f1 LONG;
> select * from t1 order by f1;
>
>
>
> -- 
> Best regards,
> Ivan Smahin
> Senior Software Engineer
> Paradigma Software, Inc
> Valentina - The Ultra-Fast Database
> http://www.valentina-db.com
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list