Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
krish001
Yak Posting Veteran
61 Posts |
Posted - 2009-11-03 : 09:55:08
|
how to get resolve divide by zero error in reports??iam using =iif(reportitems!AvailableWorkingDays_2.Value=0,"none",(reportitems!ResourceActualWorking_2.Value)/(reportitems!AvailableWorkingDays_2.Value))iam getting #error in preview |
|
JCirocco
Constraint Violating Yak Guru
392 Posts |
Posted - 2009-11-03 : 09:58:03
|
My guess is the #error is not a divide by zero error.JohnIt's a small world (but I wouldn't want to paint it) |
|
|
krish001
Yak Posting Veteran
61 Posts |
Posted - 2009-11-03 : 10:00:12
|
quote: Originally posted by JCirocco My guess is the #error is not a divide by zero error.JohnIt's a small world (but I wouldn't want to paint it)
it is divide by zero error iam getting warning |
|
|
krish001
Yak Posting Veteran
61 Posts |
Posted - 2009-11-03 : 10:02:09
|
quote: Originally posted by JCirocco My guess is the #error is not a divide by zero error.JohnIt's a small world (but I wouldn't want to paint it)
iif(reportitems!AvailableWorkingDays_2.Value=0,"",(reportitems!ResourceActualWorking_2.Value)/(reportitems!AvailableWorkingDays_2.Value))i want to show null when it is dividing by zereo |
|
|
rohitkumar
Constraint Violating Yak Guru
472 Posts |
Posted - 2009-11-03 : 10:39:41
|
add this code to your report, and use this for divisionPublic Shared Function Divide(Num1 as double, Num2 as double) AS object IF ISNOTHING(Num2) Or Num2 = 0 Then Divide = "-" ELSEIF Num1 = 0 THEN Divide = 0 ELSE Divide = Num1*1.0/Num2 END IFEnd Function |
|
|
|
|
|