Monday, September 29, 2014

Crystal Reports : Zero Divide Blues

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!

2 comments:

Anonymous said...

If you understand exactly what truck you will have, you ought to work out how you may shell out the dough. replica prada As expected, it presumes you have got unspent good enough for one down payment while not tapping into ones own catastrophe money. Calculating the fee for title, fake chanel handbags this includes propane gas, insurance plans, and even protection, should really help you to similar on at as well as the truck you should have which can be moreover on cost structure. CNN Bucks offers not alone comprehending your financial allowance well before purchasing for your vehicle, fake chanel but probably reviewing funds occuring at loan providers and even credit standing unions and even gaining pre-approved for one home loan, when you're lending ones own get. prada replica Unique trucks, implemented trucks, and even booking are typically possible choices take into consideration even while scouring shops, for one come to terms.

Coco Ada said...

Omega Watches Swiss Watches accept been the dream watch for those who apperceive a bit about watches. The sole agitation is that not anybody can pay for to acquirement it. The abatement Franck Mueller watches at www.online abundance are of the incomparable top superior which accept the ability to endure best at a decidedly bargain rates.The awfully to breitling replica activate with Omega watch was produced in 1983 and was referred to as Tourbillon. Each of the movements aural the Omega watches are developed by Omega alone, and they may be one of cartier replica its sorts back in the accomplished crafted appearance and actions.Nonetheless, there appear to be a abundant amount of additions to the watch anon afterwards it was launched in 1983 about the a lot of cogent 1 would be the abiding agenda & minute repeater. Aural just a abbreviate amount of time Cartier has advised a name for abandoned and is been admired as rolex replica the baton while in the industry. As a aftereffect of its technology and incomparable craftsmanship, Omega watches has been a accepted central the celebrity and appearance collectors. It is aswell admired for its abnormally advised dials and its ultra avant-garde cases.Adding jewels to the acme Omega Speedmaster of the Cartier band of watches could be the Casablanca which comes with an automated movement in a stainless animate case. This abnormally advised watch from Switzerland can be beat accidentally or on a dress too, as it fits both scenes actual appropriately and nicely.