Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there something like EVALUATE() fox function ?
Message
 
 
À
26/06/2006 12:29:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
01131426
Message ID:
01365210
Vues:
29
This message has been marked as the solution to the initial question of the thread.
Here's a simpler way to achieve the same result
DECLARE
	@expr 		nvarchar(100),
	@sql 		nvarchar (200),
	@yUsaAmt 	money,
	@ySpecialChrg 	money,
	@ySpecialDisc 	money,
	@yResult 	money;
	
--SET @expr = N'(@yUsaAmt * 0.05) + @ySpecialChrg - @ySpecialDisc';
--SET @expr = N'(@yUsaAmt * 0.05) + @ySpecialChrg';
SET @expr = N'(@yUsaAmt * 0.05)';

SET @yUsaAmt 	  = 150.00;
SET @ySpecialChrg = 3.00;
SET @ySpecialDisc = 1.75;

SET @sql = N'SET @yResult = ' + @expr;

EXECUTE sp_executesql @sql, 
		N'@yUsaAmt money, @ySpecialChrg money, @ySpecialDisc money, @yResult money OUTPUT',
		@yUsaAmt, @ySpecialChrg, @ySpecialDisc, @yResult OUTPUT;

SELECT @yResult;  
>Perfect!
>I will use it.
>Thanks.
>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform