在对应所需名称或序数的集合中,未找到项目。
Dimsql7,rs7,sheet7,jj=1Setsheet7=app.Sheets.Addsheet7.Name="已退药,未退费的记录"sql7="selectb....
Dim sql7,rs7,sheet7,j
j=1
Set sheet7=app.Sheets.Add
sheet7.Name="已退药,未退费的记录"
sql7="select b.recipeid,b.recipestaus,b.drugname,a.* from opb_feedetail a ,ods_recipedetail b where a.recipeid=b.recipeid"+_
" and a.itemstatus='0' and b.recipestaus='5' and a.itemid=b.drugid and (a.drugtype='1' or a.drugtype='2')"
msgbox sql7
Set rs7=CreateObject("ADODB.RecordSet")
rs7.CursorLocation=3
rs7.Open sql7,cnn,3,1
msgbox rs7.Fields.Count
'msgbox rs7.Fields(30).Value
While not rs7.EOF
For i = 0 To rs7.Fields.Count
'sheet7.Cells(j,(i+1))=IIF(isNULL(rs7.Fields(i).Value),"",rs7.Fields(i).Value)
sheet7.Cells(j,(i+1))=rs7.Fields(i).Value&""
Next
j=j+1
rs7.MoveNext
Wend 展开
j=1
Set sheet7=app.Sheets.Add
sheet7.Name="已退药,未退费的记录"
sql7="select b.recipeid,b.recipestaus,b.drugname,a.* from opb_feedetail a ,ods_recipedetail b where a.recipeid=b.recipeid"+_
" and a.itemstatus='0' and b.recipestaus='5' and a.itemid=b.drugid and (a.drugtype='1' or a.drugtype='2')"
msgbox sql7
Set rs7=CreateObject("ADODB.RecordSet")
rs7.CursorLocation=3
rs7.Open sql7,cnn,3,1
msgbox rs7.Fields.Count
'msgbox rs7.Fields(30).Value
While not rs7.EOF
For i = 0 To rs7.Fields.Count
'sheet7.Cells(j,(i+1))=IIF(isNULL(rs7.Fields(i).Value),"",rs7.Fields(i).Value)
sheet7.Cells(j,(i+1))=rs7.Fields(i).Value&""
Next
j=j+1
rs7.MoveNext
Wend 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |