Article View: borland.public.vdbase.data.sql
Article #105Re: SQL returns only integers
From: tt
Date: Fri, 15 Jan 1999 00:00
Date: Fri, 15 Jan 1999 00:00
63 lines
2168 bytes
2168 bytes
Steve,
thanks for your answer.
in the following you can find my query, source and result-table and the
environment. (this is a simplified
query, but it does not work too.)
---------
SELECT Price ,
CAST(AVG(Price) AS NUMERIC(9, 2)) AS COL1,
SUM (Price) AS COL2,
AVG (Price) AS COL3
FROM Products
GROUP BY Price
---------
Products-source-table
[Price]
0,00
100,00
123,45
234,56
---------
query-result-table
[Price]
0,00
100,00
123,45 <<<<<<<< the original is returned correctly
234,56 <<<<<<<<
[COL1] = [COL2] = [COL3]
0
100
123 <<<<<<<< sums are rounded too!
235 <<<<<<<<
---------
the field-type is N, len=8 , decimal = 2, no indexing or linking on that
field
vdb 7.0 (german, professional version), bde 4.50, using a standard
dbase-driver and table
---------
in my opinion, everything is as plain, simple and clean as it can be.
i have tried some cheating without success. (X * 100) / 100. and i have tried
several field formats,
because i thought this might be the reason - it was not.
of course i will try your cast-proposal. but this is a very elementary task
and i would not expect to use
"tricky workarounds" at this basic level. do you have an idea, what else
(perhaps in my setup) could be
the reason?
various times i already had problems passing variables to queries. i solved
them but until today i do not
know why one version did not work and the other one didi. to me it seemed
wrong. do you think, there
might be a problem with my bde-version?
thank you in advance for your help.
thomas trautwein
Technical Details
Message-ID:
<369FC156.724F04E5@trautwein.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36991111.F42B21F0@trautwein.com> <369b6710.16566284@forums.inprise.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,fc8f9f82181d59ea X-Google-Attributes: gidff5a1,public From: tt <thomas@trautwein.com> Subject: Re: SQL returns only integers Date: 1999/01/15 Message-ID: <369FC156.724F04E5@trautwein.com> X-Deja-AN: 433124748 Content-Transfer-Encoding: 7bit References: <36991111.F42B21F0@trautwein.com> <369b6710.16566284@forums.inprise.com> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.vdbase.data.sql