Hey all! I have a report with 2 fields,
"UnitsSold" and "PrevTotSold"
I need to calculate the percentage of change in these fields. I have created a textbox with the control source..
=([UnitsSold]-[PrevTotSold])/[PrevTotSold] set as a percent. This works great if there are units sold and previous units, but if [PrevTotSold] happens to be 0, then I get a Div/0 error. This should really be 100 percent. If the [UnitsSold] is zero, I get a #Num! error..this should be 0%. How can I say Div/0=100% and #Num!=0%
or is there a better way to do it??
Thanks for your help!!!!
"UnitsSold" and "PrevTotSold"
I need to calculate the percentage of change in these fields. I have created a textbox with the control source..
=([UnitsSold]-[PrevTotSold])/[PrevTotSold] set as a percent. This works great if there are units sold and previous units, but if [PrevTotSold] happens to be 0, then I get a Div/0 error. This should really be 100 percent. If the [UnitsSold] is zero, I get a #Num! error..this should be 0%. How can I say Div/0=100% and #Num!=0%
or is there a better way to do it??
Thanks for your help!!!!