Groups > dBase > dBase SQL Servers > Re: Irregular Query Results




Irregular Query Results

Irregular Query Results
Sun, 06 Jan 2008 11:38:23 -050
I found an interesting issue that I wanted to present.  All queries (dbase) work
properly when DECIMALS = 2, but they produce incorrect results when DECIMALS =
0.  Is this a dBase bug, or can someone help me understand the cause.

Thanks in advance.

Post Reply
Re: Irregular Query Results
Sun, 06 Jan 2008 19:22:14 +010
On Sun, 06 Jan 2008 11:38:23 -0500, in dbase.sql-servers, 
Subject: Irregular Query Results, 
Message-ID: <Qcm8NKIUIHA.1700@news-server>,  
john marshall <john.marshall@NOSPAM.com> wrote:

>
>I found an interesting issue that I wanted to present.  All queries (dbase)
work properly when DECIMALS = 2, but they produce incorrect results when
DECIMALS = 0.  Is this a dBase bug, or can someone help me understand the
cause.

It would be easier to answer if you explained in which way the results are
irregular, and what you
mean by incorrect results.

You might even illustrate the problem by posting a turnkey demo.


Post Reply
Re: Irregular Query Results
Mon, 7 Jan 2008 01:30:34 -0500
In article <Qcm8NKIUIHA.1700@news-server>, john.marshall@NOSPAM.com 
says...
> 
> I found an interesting issue that I wanted to present.  All queries (dbase)
work properly when DECIMALS = 2, but they produce incorrect results when
DECIMALS = 0.  Is this a dBase bug, or can someone help me understand the
cause.
> 
> Thanks in advance.
> 
> JM
 
John,

What kind of queries are you talking about? I have not heard of this 
type of thing before. Which version of dBASE?

-- 
Geoff Wass [dBVIPS]
Montréal, Québec, Canada

.|.|.|        dBASE info at http://geocities.com/geoff_wass       |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
Post Reply
Re: Irregular Query Results
Mon, 7 Jan 2008 09:08:59 -0800
> When I'd "sum" a field range (SQL) using decimals set at 0, I'd
get a 
> result (wrong) far different than when decimals were set to 2.  I 
> discovered that a new subroutine had set decimals to 0, and this was 
> inherited by the parent, which screwed up all the report results.  Once I 
> explicitly set decimals to 2 in the parent, the results were fine again.
> JM

At least you know how to make it work correctly! That sounds vaguely similar 
to a known dBase SQL bug, that if the width of a numerical field is too 
narrow, one may get erroneous results from a query with the SUM() function, 
especially with calculations like 'sum(field*field)' where the width of the 
answer is much wider than the original field.
E.L.

Post Reply
Re: Irregular Query Results
Mon, 07 Jan 2008 10:43:09 -050
When I'd "sum" a field range (SQL) using decimals set at 0, I'd get a
result (wrong) far different than when decimals were set to 2.  I discovered
that a new subroutine had set decimals to 0, and this was inherited by the
parent, which screwed up all the report results.  Once I explicitly set decimals
to 2 in the parent, the results were fine again.

JM


Ivar B. Jessen Wrote:

> On Sun, 06 Jan 2008 11:38:23 -0500, in dbase.sql-servers, 
> Subject: Irregular Query Results, 
> Message-ID: <Qcm8NKIUIHA.1700@news-server>,  
> john marshall <john.marshall@NOSPAM.com> wrote:
> 
> >
> >I found an interesting issue that I wanted to present.  All queries
(dbase) work properly when DECIMALS = 2, but they produce incorrect results when
DECIMALS = 0.  Is this a dBase bug, or can someone help me understand the
cause.
> 
> It would be easier to answer if you explained in which way the results are
irregular, and what you
> mean by incorrect results.
> 
> You might even illustrate the problem by posting a turnkey demo.
> 
> 
> Ivar B. Jessen
Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact