When included in the report it complains with the following message: "Division by zero". I found an article which suggested I make adjustment below to the formula but I get the same error. Any ideas?
(If {@Profit} = 0 then 1 else {@Profit}) / {tblInvoices.TotalNetSell}
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 12 May 2009 at 12:58pm
you were close, you needed to account for the tblInvoices.TotalNetSell as a possible 0, also you proabably want a 0 rather than a 1 as the then statement as this woul be 0%. You can also use % instead of / to get a percentage:
If {tblInvoices.TotalNetSell} = 0 then 0 else {@Profit} % {tblInvoices.TotalNetSell}
Joined: 19 Feb 2009
Online Status: Offline
Posts: 48
Posted: 12 May 2009 at 2:17pm
Many thanks to both of you!
DBlank your suggestion worked like a champ! Is it possible to include the percent sign "%" in the formula so results will display like so: 51.2% instead of 51.2?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum