梦幻西游大唐必带法宝:错误问题!asp中的if 语句!

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 22:48:30
帮忙看一下!这个语句有什么错误!
谢谢!
i=10 '0为上午正常出勤,1为上午上班迟到,2为下午正常上班,3为下午上班迟到,4为上午早退,5为下午早退,7、8为正常下班。
if rs("bIsIn")=1 then
if right(rs("sTime"),8)<= settime("amcometime") then
i=0 '上午上班正常
else
if settime("amcometime")< right(rs("sTime"),8) and right(rs("sTime"),8)< settime("amgotime") then 'amgotime 为上午下班时间设定值
i=1 '上午上班迟到
else
if settime("amgotime") <= right(rs("sTime"),8) and right(rs("sTime"),8)<= settime("pmcometime") then 'pmcometime 为下午上班时间设定值
i=2 '下午上班正常
else
if right(rs("sTime"),8) > settime("pmcometime") then
i=3 '下午上班迟到
end if
else
if settime("amcometime") < right(rs("sTime"),8) and right(rs("sTime"),8)< settime("amgotime") then
i=4 '上午上班早退
elseif settime("amgotime")<= right(rs("sTime"),8) and right(rs("sTime"),8)< settime("pmcometime") then
i=7 '上午下班正常
elseif settime("pmcometime")< right(rs("sTime"),8) and right(rs("sTime"),8)< settime("pmgotime") then
i=5 '下午上班早退
elseif settime("pmgotime")<= right(rs("sTime"),8) then
i=8 '下午下班正常
end if
end if
i=10
if rs("bIsIn")=1 then
if right(rs("sTime"),8)<= settime("amcometime") then
i=0 '上午上班正常
elseif settime("amcometime")< right(rs("sTime"),8) and right(rs("sTime"),8)< settime("amgotime") then
i=1 '上午上班迟到
elseif settime("amgotime") <= right(rs("sTime"),8) and right(rs("sTime"),8)<= settime("pmcometime") then
i=2 '下午上班正常
elseif right(rs("sTime"),8) > settime("pmcometime") then
i=3 '下午上班迟到
end if
else
if settime("amcometime") < right(rs("sTime"),8) and right(rs("sTime"),8)< settime("amgotime") then
i=4 '上午上班早退
elseif settime("amgotime")<= right(rs("sTime"),8) and right(rs("sTime"),8)< settime("pmcometime") then
i=7 '上午下班正常
elseif settime("pmcometime")< right(rs("sTime"),8) and right(rs("sTime"),8)< settime("pmgotime") then
i=5 '下午上班早退
elseif settime("pmgotime")<= right(rs("sTime"),8) then
i=8 '下午下班正常
end if
end if

用Select Case吧,看你写得那么辛苦。
Select Case i
case 1
case 2
case 3,4
……
end select

累死人,不看了!