Sunday, March 4, 2012

Reporting services divide by 0

RS handles ints differently than floats

regarder:
creat table thus
create table test3(a int,b int,c decimal(18,3),d decimal(18,3) )goinsert into test3 values(0,4,0,67)
BTW I use the following code to avoid issues

 Public Function Divide(ByVal first As Double, ByVal second As Double) As Double
        If second = 0 Then
            Return 0
        Else
            Return first / second
        End If
    End Function
I didnt have luck or time to figure out the other ideas I've found on the internet

No comments:

Post a Comment