G
Guest
I am trying to write an expression to calculate the percentage difference
between two numbers and list it in a query.
My problem is that some of my values are zero. Since I can’t divide by zero
I thought I would write an expression to give me a default value, such as 0%
For example if I had two zero amounts then I would just return a zero.
If I have two amounts greater than zero I would return the percent difference.
If I was trying to divide a number greater than zero by a zero, then I need
to return that value. E.g. 5000/0 = 5000
I tried using the IIF conditional expression, but I can only have two cases.
Any advice would be appreciated.
Ken
between two numbers and list it in a query.
My problem is that some of my values are zero. Since I can’t divide by zero
I thought I would write an expression to give me a default value, such as 0%
For example if I had two zero amounts then I would just return a zero.
If I have two amounts greater than zero I would return the percent difference.
If I was trying to divide a number greater than zero by a zero, then I need
to return that value. E.g. 5000/0 = 5000
I tried using the IIF conditional expression, but I can only have two cases.
Any advice would be appreciated.
Ken