View Single Post
  #2  
Old 20th May 2020, 10:31
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,449
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Basically, you would need to check the value of your Divisor before going ahead with division.

e.g. If the calculation is at Report Script level. Instead of

Code:
detail.1:
before.layout:
percent = x/y

You can do something like this -

Code:
detail.1:
before.layout:
     if y > 0 then
           percent = x/y
     else
           percent = 0
     endif

That would make sure you don't get Divide by Zero errors.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote