以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 加个判断 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=187734) |
-- 作者:cyrollin -- 发布时间:2023/8/8 9:48:00 -- 加个判断 请问怎么加个判断?在姓名里面找到字符 “(实习)”时, dr(dc.name) = 2, 否则就 dr(dc.name) = 1 For Each dr As DataRow In DataTables("考勤表").Select("姓名 is not null") For i As Integer = 1 To dr.DataTable.DataCols.count-2 dr(dr.DataTable.DataCols(i).name) = Nothing Next For Each cdr As DataRow In dt.Select("\',\'+休息+\',\' like \'%," & dr("姓名") & ",%\'") For i As Integer = 1 To dr.DataTable.DataCols.count-2 Dim dc = dr.DataTable.DataCols(i) If dc.caption = cdate(cdr("日期")).day Then dr(dc.name) = 1 End If Next Next Next |
-- 作者:有点蓝 -- 发布时间:2023/8/8 10:01:00 -- if dr("姓名") like “*(实习)*” dr(dc.name) = 2 else dr(dc.name) = 1 endif
|