Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there something like EVALUATE() fox function ?
Message
 
 
To
26/06/2006 12:29:33
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01131426
Message ID:
01365210
Views:
30
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform