[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: [sqr-users] SQR Bug.



Larry,

I have tried assigning 0 to the variable as well and that made no
difference.

Regards,
Ian Mills
ORIX Australia Corp. Ltd.

>>> lroux@syr.edu 22/12/2003 9:11:23 am >>>
Could there be a value in #_gf_prim_g1 before you do the add?  I have
seen assigned numbers be wrong in the deep bowels of the decimals but
never in the integer portion.

I would set #_gf_prim_g1 to 0 before the select to make sure something
else has not set it.


******************************
Larry Roux
Syracuse University
lroux@syr.edu 
*******************************
>>> Ian.Mills@orix.com.au 12/21/03 16:39 PM >>>
Hi All,

I am using SQR v6.1.3 on my Win2K PC, and running against an Oracle
database.

I have had a report that has worked fine for the last 5 months. My
company as just migrated the rest of the data from there old system to
the new system so the report now sums up 5 times the data. The problem
I
am having is that I run a SELECT statement to return a value. The
value
returned from the query is correct, but when I assign it to a global
variable, the number changes.

Here is the offending source code...
begin-select
sum(TOTAL_DOCL_PRICE) &sales
sum(nvl((select sum(TAX_VALUE) FROM DOCL_TAXES Where DOCL_DOC_ID =
l.doc_id and DOCL_LINE_ID = l.line_id and (ANALYSIS_CODE like
'%-PSD-O%'
or ANALYSIS_CODE like '%-LCT-O%')),0))  &psd_exclude_amount

    add &sales to #_gf_prim_g1                       ! ***************
offending line

    add &psd_exclude_amount to #_gf_prim_g3
    add &psd_exclude_amount to #_gf_sec_g3

    subtract #_gf_extra_ar_gst_error from #_gf_prim_g1

from doc d,
....

After the end-select I show the values to write them to the log file
    #debugt show ''
    #debugt show 'SALES : ' &sales '           Current G1 : ' 
#_gf_prim_g1
    #debugt show ''

The results in the log file are as follows...
SALES : 38925864.48           Current G1 : 37114136.550000



I have tried altering the code and instead of using ADD I used "let
#_gf_prim_g1 = #_gf_prim_g1 + &sales", "let #_gf_prim_g1 = &sales" and

"let #_gf_prim_g1 = &sales * 1.0", but they all produce the same
error.
My first guess would have been a size restriction on the FLOAT data
type
but I have other reports on other systems that have values in the
billions of dollars. This is only $37 million.

Has anyone encountered anything like this before? Does anyone have any
ideas on how to fix it or code around it to give the variable the
right
value?

Thanks in advance.

Regards,
Ian Mills
ORIX Australia Corp. Ltd.


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users 


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users 


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users