S
SF
Hi,
I have the following
IIf((nz([07 Qtr 3],0)-nz([07 Qtr 2],0))=0,0,(nz([07 Qtr 3],0)-nz([07 Qtr
2],0))/(nz([07 Qtr 3],0)+nz([07 Qtr 2],0)))
It work well in query, Is there a way to code this into a function? I try
the following but it return #Error in query result
Public Function Convert2Dlb(AnyNumber As Variant) As Double
'CDbl(nz([FY 07],0))
Convert2Dlb = CDbl(Nz(AnyNumber, 0))
End Function
Public Function PCal(Value1 As Double, Value2 As Double) As Double
Select Case Convert2Dlb(Nz(Value2, 0)) - Convert2Dlb(Nz(Value1, 0))
Case Is = 0
PCal = 0
Case Else
PCal = (Convert2Dlb(Value2) - Convert2Dlb(Value1)) /
(Convert2Dlb(Value1) + Convert2Dlb(Value2))
End Select
End Function
SF
I have the following
IIf((nz([07 Qtr 3],0)-nz([07 Qtr 2],0))=0,0,(nz([07 Qtr 3],0)-nz([07 Qtr
2],0))/(nz([07 Qtr 3],0)+nz([07 Qtr 2],0)))
It work well in query, Is there a way to code this into a function? I try
the following but it return #Error in query result
Public Function Convert2Dlb(AnyNumber As Variant) As Double
'CDbl(nz([FY 07],0))
Convert2Dlb = CDbl(Nz(AnyNumber, 0))
End Function
Public Function PCal(Value1 As Double, Value2 As Double) As Double
Select Case Convert2Dlb(Nz(Value2, 0)) - Convert2Dlb(Nz(Value1, 0))
Case Is = 0
PCal = 0
Case Else
PCal = (Convert2Dlb(Value2) - Convert2Dlb(Value1)) /
(Convert2Dlb(Value1) + Convert2Dlb(Value2))
End Select
End Function
SF