[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.



I agree with Clark. Try this:

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

  show 'Curr Sales = ' &sales  ' gf prim g1' #_gf_prim_g1




******************************
Larry Roux
Syracuse University
lroux@syr.edu
*******************************
>>> ceprn@hotmail.com 12/21/03 17:49 PM >>>
I would get away from Add, unless you're really *adding* something - use a 
let, or if you must, a move.

**HINT** More than likely you are returning more than one row; the &sales 
will only show the last row returned, if your show is outside the select, 
but the #_gf_prim_g1 will show the sum of the addition of the multiple rows.

You could also do a show on the #_gf_prim_g1 variable before the select and 
see what is in it.

clark 'the dragon' willis
How can I be so good, yet unemployed, when H1Bs are getting the jobs? hee 
hee hee


PSA: Salary <> Slavery.  If you earn a salary, your employer is renting your 
services for 40 hours a week, not purchasing your soul.  Your time is the 
only real finite asset that you have, and once used it can never be 
recovered, so don't waste it by giving it away.

"Time is the coin of your life. It is the only coin you have, and only you 
can determine how it will be spent.  Be careful lest you let other people 
spend it for you."

Carl Sandburg
(1878 - 1967)


----Original Message Follows----

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.

_________________________________________________________________
Enjoy the holiday season with great tips from MSN.  
http://special.msn.com/network/happyholidays.armx

_______________________________________________
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