Dim cmd As new SQLCommand
cmd.C
cmd.CommandText = "sele ct a.*,b.部门,b.姓名,b.在职情况,b.编号,b.考勤员,c.姓名 as 处罚考勤员,"
cmd.CommandText &= " (case when a.fid = 0 then '待确认' when a.fid = 2 then '已确认' when a.fid = 1 then '待减免' when a.fid = 3 then '已减免' else '' end ) as 签核状态 "
cmd.CommandText &= " from [" & Vars("Mes") & "].dbo.处罚表 as a"
cmd.CommandText &= " left join [" & Vars("Mes") & "].dbo.员工表 as b on a.useid = b.编号 "
cmd.CommandText &= " left join [" & Vars("Mes") & "].dbo.员工表 as C on a.kqid = b.编号 "