Don't you think false part in your IIF statement is messing?
I have an example for you that I used in my query which gives me desired result. Here it is.
IIf([SumOfPAmount]-([RunningAmount]-[Amount])>0,[SumOfPAmount]-([RunningAmount]-[Amount]),0)) AS Adjusted,
This would give you an idea I hope.
Ashfaque
|