以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  数值区间判断  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=174749)

--  作者:爱相随
--  发布时间:2022/1/29 11:07:00
--  数值区间判断
老师,下面代码所有结果都为10,麻烦帮忙看看是哪里出了问题??

If e.DataCol.Name = "本公司服务年限" Then \'发生变化的是产品编号吗?
   If e.DataRow.IsNull("本公司服务年限") Then
            e.DataRow("法定年假") = Nothing
        Else
          If e.DataRow("本公司服务年限") >= 20
             e.DataRow("法定年假") = 15
         ElseIf 10 <= e.DataRow("本公司服务年限") < 20
             e.DataRow("法定年假") = 10
         ElseIf 1 <= e.DataRow("本公司服务年限") < 10
             e.DataRow("法定年假") = 5
         Else
             e.DataRow("法定年假") = 0
       End If
    End If
End If

--  作者:有点蓝
--  发布时间:2022/1/29 11:18:00
--  
代码没有问题的。看看是不是有其它代码影响了