Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Values Negatives
Message
From
04/12/2005 05:42:39
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MySQL
Miscellaneous
Thread ID:
01074636
Message ID:
01074713
Views:
14
>Hi!!, I Have a Problem, I use the following code:
>
>
>SELECT C_Cumplimiento
>APPEND blank
>SELECT sumas	
>SCAN WHILE !EOF()
>  lns = (sumas.sumrcobranza10/IIF(sumas.sumpcobranza10 = 0,1,sumas.sumpcobranza10)*100)
>  lns2= (1 - lns)
>  SELECT C_Cumplimiento
>  replace concepto WITH "% CUMP. COBRANZA"
>  replace mes10    WITH lns2
>ENDSCAN
>
>
>in The Cursor Sumas sumrcobranza10 = 1357125.16 and sumpcobranza10 = 2588065.00 but the Value that Display is mes10 = -51.43, and This is not correct. If use:
> replace mes10 WITH lns the Value That Display is Correcto because Display 52.43 but my problem is when use lns2= (1 - lns) ..
>Why???

When you want read a variable you must to use the m. alias:
APPEND blank IN C_Cumplimiento

SELECT sumas	
SCAN REST
  lns = sumrcobranza10/EVL(sumpcobranza10,1)*100 && sure *100 ?
  lns2= 1 - m.lns
* sure you want replace this many times ?
replace concepto WITH "% CUMP. COBRANZA"
      , mes10    WITH m.lns2 IN C_Cumplimiento
ENDSCAN
Previous
Reply
Map
View

Click here to load this message in the networking platform