discusmania
IS-IT--Management
Hi All... ihave the codes below but it will give me this error when i ran it:
Microsoft VBScript runtime error '800a000d'
Type mismatch
/dept/AMT/Software/causes/quality_measurement.asp, line 225
where line 225 is: dpku=no_defect/total_handle * 1000
please help me to rectify what's the problem
regards, Ron
function query_dpku(weekend_str,year_str,crew,area,line)
dim weekend
if not opendb_mdamqs then response.end
cmd1="select count(defect) no_of_defect,process from defects where substr(fe_shift,3)='"&crew&"'" &_
" and fe_shift is not null and length(fe_shift)=3 "&_
" and testdate BETWEEN to_date('"& start_date & " 00:00:00','dd-mon-yyyy hh24:mi:ss') AND" &_
" to_date('" & end_date & " 23:59:59','dd-mon-yyyy hh24:mi:ss') "&_
" group by process, fe_shift"
response.write cmd1 &"<br>"
set rsdefect=cn4.execute(cmd1)
aDefect=rsdefect.getrows
cmd2="select sum(phand) total_handle, process from sm_track where " &_
" datetime BETWEEN to_date('"& start_date & " 00:00:00','dd-mon-yyyy hh24:mi:ss') AND" &_
" to_date('" & end_date & " 23:59:59','dd-mon-yyyy hh24:mi:ss') "&_
" group by process"
Response.Write cmd2
set rshand=cn4.execute(cmd2)
aHand=rshand.getrows
for i=0 to ubound(aHand,2)
station_h=aHand(1,i)
total_handle=aHand(0,i)
for j=0 to ubound(aDefect,2)
station_d=aDefect(1,j)
'Response.Write "<br>" & station_d & "STATION D"
no_defect=aDefect(0,j)
if strcomp(station_h,station_d)=0 then
if (no_defect<>"0" and total_handle<>"0" then
Response.Write "<br>" & no_defect &"/" & total_handle
dpku=no_defect/total_handle * 1000
Response.Write "<br> DPKU: "&dpku
end if
end if
next
next
end function
Microsoft VBScript runtime error '800a000d'
Type mismatch
/dept/AMT/Software/causes/quality_measurement.asp, line 225
where line 225 is: dpku=no_defect/total_handle * 1000
please help me to rectify what's the problem
regards, Ron
function query_dpku(weekend_str,year_str,crew,area,line)
dim weekend
if not opendb_mdamqs then response.end
cmd1="select count(defect) no_of_defect,process from defects where substr(fe_shift,3)='"&crew&"'" &_
" and fe_shift is not null and length(fe_shift)=3 "&_
" and testdate BETWEEN to_date('"& start_date & " 00:00:00','dd-mon-yyyy hh24:mi:ss') AND" &_
" to_date('" & end_date & " 23:59:59','dd-mon-yyyy hh24:mi:ss') "&_
" group by process, fe_shift"
response.write cmd1 &"<br>"
set rsdefect=cn4.execute(cmd1)
aDefect=rsdefect.getrows
cmd2="select sum(phand) total_handle, process from sm_track where " &_
" datetime BETWEEN to_date('"& start_date & " 00:00:00','dd-mon-yyyy hh24:mi:ss') AND" &_
" to_date('" & end_date & " 23:59:59','dd-mon-yyyy hh24:mi:ss') "&_
" group by process"
Response.Write cmd2
set rshand=cn4.execute(cmd2)
aHand=rshand.getrows
for i=0 to ubound(aHand,2)
station_h=aHand(1,i)
total_handle=aHand(0,i)
for j=0 to ubound(aDefect,2)
station_d=aDefect(1,j)
'Response.Write "<br>" & station_d & "STATION D"
no_defect=aDefect(0,j)
if strcomp(station_h,station_d)=0 then
if (no_defect<>"0" and total_handle<>"0" then
Response.Write "<br>" & no_defect &"/" & total_handle
dpku=no_defect/total_handle * 1000
Response.Write "<br> DPKU: "&dpku
end if
end if
next
next
end function