Your @ line formula is giving you a negative result. You are using it in the @profit and subtracting it. Subtracting a negative # is actually adding that amount so you should never end up with a negative amount correct?
This should have no impact on it displaying 0 unless it makes your @profit = 0.
Usually with these I break my formula up to test the parts to make sure I get the result from the parts that I expect and then I put them back together (usually after I fix the broken part).
My guess is you may have a problem with the ultimate result of your @profit . To make it all one formula for testing it would be:
Does this get you the amount you expect for the profit?
Edited by DBlank - 09 Jun 2009 at 5:30pm