Tuesday, April 29, 2014

Crystal Reports : Trapping for Zero Divide

When division occurs within calculated fields, there is always the risk of getting the dreaded "zero divide error". This happens, obviously, when a calculation tries to divide the number zero.

And since we all know that underlying data cannot be trusted 100%, it is necessary to test for these zero divide errors within our Formula Field.

Example: The formula field called {frmSalesPerDay} is a simple division of {NumSales} by {NumDays}.

So our {frmSalesPerDay} code should look like this:

if {NumSales} = 0 then 0 else {NumSales} / {NumDays}

So, if {NumSales} equals zero, then we simply return a zero and exit the formula. Otherwise, we let it perform the division.

This is important any zero divide error will halt the report completely!

1 comment:

Jeffer Shen said...

This all contributes in to the total indicate upwards value of these hand bags chanel replica sale which usually could have been stored in the event you acquired simply produced the time and effort to get Chanel totes on-line. Today the particular issue develops regarding irrespective of louis vuitton replica uk whether or not you’ll manage to really identify low priced traditional Chanel hand bags on the web which can be really authentic and also chanel replica sale furthermore a better solution will be sure it is possible to! Ab muscles little determined key about where you should obtain traditional Chanel hand bags on the web is always to find out antique, concluded or perhaps a bit applied Chanel hand bags on the market. Don’t acquire us all completely wrong, you might be louis vuitton replica uk capable of however find out manufacturer fresh Chanel types on the net coming from trustworthy vendors yet they could be number of and also significantly among. One of many leading chanel replica uk graded and a lot well-liked sites to discover the most effective Chanel bag on the net to your private assortment will be craigs list. Below many times many specialist distributors or perhaps beginner lovers that have made their particular unique listing of hard-to-find Chanel hand bags.