Re: [sqlite] Is there a way to do comparison of text in a numerical way.

2007-12-10 Thread Mag. Wilhelm Braun
Thanks for the hint. W.Braun Dennis Cote wrote: Mag. Wilhelm Braun wrote: I thought that this might properly a bigger thing. Well, I found a solution which fits my purpose at the moment. ( SELECT txt FROM test WHERE txt=(SELECT max(CAST(txt AS REAL)) from test) ) I do not use selection of

Re: [sqlite] Is there a way to do comparison of text in a numerical way.

2007-12-10 Thread Dennis Cote
Mag. Wilhelm Braun wrote: I thought that this might properly a bigger thing. Well, I found a solution which fits my purpose at the moment. ( SELECT txt FROM test WHERE txt=(SELECT max(CAST(txt AS REAL)) from test) ) I do not use selection of max() or min() very often - it seems it is the be

Re: [sqlite] Is there a way to do comparison of text in a numerical way.

2007-12-09 Thread Mag. Wilhelm Braun
Thanks, I thought that this might properly a bigger thing. Well, I found a solution which fits my purpose at the moment. ( SELECT txt FROM test WHERE txt=(SELECT max(CAST(txt AS REAL)) from test) ) I do not use selection of max() or min() very often - it seems it is the best suiting solution

Re: [sqlite] Is there a way to do comparison of text in a numerical way.

2007-12-09 Thread John Stanton
We built a fixed point arithmetic library using text strings. The format stored is right justified, leading space filled decimal numbers with embedded decimal points and leading sign. The purpose of that is not for arithmetic efficiency but so that they can be directly output into a printed p

Re: [sqlite] Is there a way to do comparison of text in a numerical way.

2007-12-09 Thread Mag. Wilhelm Braun
Thanks Stanton, could you elaborate a bit on that - I'm not sure if I get exactly what you mean. if you have a smallish example would be great. the help from 'Igor Tandetnik' with cast is a good starting point - but on selections with max or min I still get the incorrect rounded numbers back

Re: [sqlite] Is there a way to do comparison of text in a numerical way.

2007-12-08 Thread John Stanton
Our approach to that problem was to write a library of ASCII decimal arithmetic functions, store the data as underlying type TEXT but give them a declared type of DECIMAL(n,m) and have added functions which understand that declared type. With that addition Sqlite becomes useful for accounting

[sqlite] Is there a way to do comparison of text in a numerical way.

2007-12-08 Thread Mag. Wilhelm Braun
Dear all, I use sqlite to store numerical text strings. Why do I use text type: because of the float problem of incorrection. example in numeric Columns: 3.2009returns as 3.2008 which is not what I want. Column Type=TEXT is there a way to do comparison of text in a num