Show +/- is calculation

ashley25

Registered User.
Local time
Today, 08:02
Joined
Feb 17, 2013
Messages
46
I have a basic SQL query that calculates the difference between numbers in two different tables. By default, the - sign shows if the numbers have dropped, however, how do I get increase to be prefixed with a + sign?
 
If you you wanted this value to show in a single field then it would have to become a string data type and you could do this easily using a standard IIF statement (IIF([prevVal]=[currVal], "0", IIF([prevVal]>[currVal],"-" & ([prevVal]-[currVal]), "+" & ([currVal]-[prevVal]))) . If you wanted to retain the difference as a number data type then I think you could only do this by fudging an expression field to create the '-' or '+' character (using logic as above) next to the calculated difference value. Have the difference always represented as a positive number by comparing prev value to current value and always subtracting the smaller from the greater

David
 

Users who are viewing this thread

Back
Top Bottom