Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why these two commands will give different results
Message
 
 
À
05/12/2006 00:52:22
Thomas Ganss (En ligne)
Main Trend
Frankfurt, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01174441
Message ID:
01174864
Vues:
10
>Naomi,
>
>I'ld be worried that a select might change the active alias so I'ld use code like below. But the reason is probably in a different interpretation in SQL and xBase (as modified by SET ANSI and set Exact <g>) of
>inv_no+salesman = m.ccinv + m.Slsman
>
>>
>SELECT Comision
>lnRecno = RECNO()  && Dunno what for
>
>SELECT SUM(rate*SHARE/10000) AS crate
>                WHERE inv_no+salesman = m.ccinv + m.Slsman ;
>              	FROM comision INTO ARRAY laArr
>
>SELECT Comision
>SET ORDER TO com_inv IN comision
>IF SEEK(m.ccinv + m.Slsman)                	
>	SUM (rate*SHARE/10000) TO cRate WHILE inv_no+salesman = m.ccinv + m.Slsman
>ELSE
>	cRate = 0
>endif		
>                	
>lcRate = EVL(laArr[1],0)
>IF NOT m.cRate = m.lcRate
> 	=MESSAGEBOX("Found a mismatch on " + m.ccinv + m.Slsman)
>	_cliptext = _cliptext + "Found a mismatch on " + m.ccinv + m.Slsman + " cRate = " + ;
>        	TRANSFORM(m.cRate)  + " laArr[1]= " + TRANSFORM(m.lcRate)
>ENDIF
>
>regards
>
>thomas

I do not see a difference with my current code in this one. The saving of recno is important since SUM changes record pointer.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform