Mark D. Stock wrote:
>
> Rich Newell wrote:
> >
> > I have a table that stores rates for commodity trades in a field that
> > was
> > created as a smallfloat. My problem is with the display of this data.
> > When
> > I use a simple sql script to display this data I only see 2 decemial
> > positions but If I display this data using a FORM,which was created
> > using
> > ISQL and taking all the defaults, the data displays correctly. If I
> > use
> > ODBC to get this data it displays or stores to a file correctly.
> > Why can I not see the data correctly using a sql script thru ISQL????
>
> Well give us a clue as to what the correct display would be. It sounds
> as though the data is stored with two decimal places and you want to see
> more than two. Try one of the following:
>
> SELECT ROUND(my_col,3)
> FROM my_table
> WHERE etc...
> or
> SELECT TRUNC(my_col,3)
> FROM my_table
> WHERE etc...
>
> Where 3 is the number of decimal places to display. ROUND rounds, TRUNC
> truncates. Beware that if the data type is MONEY, these functions will
> omit the currency symbol.
>
> Hope that helps,
> --
> Mark.
>
> +----------------------------------------------------------+-----------+
> |Mark D. Stock - Informix SA http://www.informix.com |//////// /|
> |mailto:mdstock@informix.com FAQ http://www.iiug.org |///// / //|
> | +-----------------------------------+//// / ///|
> | Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////|
> | Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////|
> |Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////|
> +----------------------+-----------------------------------+-----------+
I am using Netscape Livewire w/ 7.22 and have a similar problem. I can
run a web-query using ROUND and with any decimal places included, it
WILL NOT WORK. However, I can copy onstat -g sql nnn right into
dbaccess and run the same query, and get the correct precision. It
seems to have about 16 digits behind the decimal using the application,
but TRUNC and ROUND work directly in INFORMIX.
Any Ideas?