我编写了一个函数,它返回通过 SSRS 输入的 8 个数值的最小值。
问题是并不总是有 8 个值,如果没有,我会在 SSRS 中收到错误消息。我认为这是因为我正在为函数提供空值
我从不使用VB,有没有人可以告诉我一个解决方法?
使用的代码如下在此处输入代码
Function minimumReading(reading0 as String
,reading1 as String
,reading2 as String
... 7 as String)
Dim a(7) as String
a(0) = reading0
a(1) = reading1
...
a(7) = reading7
Dim max as string
Dim min as string
max = a(3)
min = a(3)
Dim i as integer
for i = Lbound(a) to Ubound(a)
if a(i) < min Then min = a(i)
next i
minimumReading = min
End Function`
提前致谢