asp 如何再序号前面不足两位添加零
"&k+1&"这个就是序号。怎样可以不足两位的情况下前面加零。比如1等于01,2等于02PublicSubTipsListIndexShow3(page,commendu...
"&k+1&" 这个就是序号。怎样可以不足两位的情况下前面加零。比如1等于01,2等于02
Public Sub TipsListIndexShow3(page,commenduserid)
commenduserid=FunCls.Sift_Str(commenduserid,1)
if page="" or page=0 then
page=1
end if
If commenduserid="" or commenduserid=0 Then
SQL="SELECT startdate,matchtype,sp,pk,xp,Commend,xxzs,bf,result,typeid,commenduserid,id,publicdate,ds,sflx From tips_Match Where typeid=2 order by startdate desc"
Else
SQL="SELECT startdate,matchtype,sp,pk,xp,Commend,xxzs,bf,result,typeid,commenduserid,id,publicdate,ds,sflx From tips_Match where CommendUserid="&commenduserid&" order by startdate desc"
End If
AdoRs.Open SQL,AdoCn,1,1
if not (AdoRs.eof and AdoRs.bof) then
'FunCls.divpage adors.recordcount,page
'AdoRsAry=AdoRs.getrows()
'RsCount=ubound(AdoRsAry,2)
pagenum=20'总分页数
AdoRsAry=AdoRs.getrows()
RsCount=ubound(AdoRsAry,2)
if (RsCount+1) mod pagenum<>0 and (RsCount+1)>pagenum then
pagetotal=(RsCount+1)\pagenum+1
elseif (RsCount+1) mod pagenum=0 then
pagetotal=(RsCount+1)\pagenum
else
pagetotal=1
end if
pagestr=FunCls.UDPpageshow(RsCount,pagetotal,pagenum,page)'
if page=1 then
j=0
else
j=(page-1)*pagenum
end if
if page*pagenum>rscount then
n=rscount
else
n=(page)*pagenum-1
end if
for k=j to n
startdate=FunCls.ChgDate5(AdoRsAry(0,k))
publicdate=AdoRsAry(12,k)
if trim(publicdate)="21" then
publicdate=AdoRsAry(0,k)
end if
if int(adorsary(14,k))=1 then
Commendstr=""&AdoRsAry(5,k)&""
else
If publicdate<now() Then
'Commendstr=AdoRsAry(5,k)
Commendstr="<font color=#ffff00><b>"&AdoRsAry(5,k)&"</b></font>"
Else
Commendstr="<font color=#f5b400><b>"&sflx(adorsary(10,k))&"</b></font>"
End If
end if
CommendUserName=commenduserary(adorsary(10,k)) 展开
Public Sub TipsListIndexShow3(page,commenduserid)
commenduserid=FunCls.Sift_Str(commenduserid,1)
if page="" or page=0 then
page=1
end if
If commenduserid="" or commenduserid=0 Then
SQL="SELECT startdate,matchtype,sp,pk,xp,Commend,xxzs,bf,result,typeid,commenduserid,id,publicdate,ds,sflx From tips_Match Where typeid=2 order by startdate desc"
Else
SQL="SELECT startdate,matchtype,sp,pk,xp,Commend,xxzs,bf,result,typeid,commenduserid,id,publicdate,ds,sflx From tips_Match where CommendUserid="&commenduserid&" order by startdate desc"
End If
AdoRs.Open SQL,AdoCn,1,1
if not (AdoRs.eof and AdoRs.bof) then
'FunCls.divpage adors.recordcount,page
'AdoRsAry=AdoRs.getrows()
'RsCount=ubound(AdoRsAry,2)
pagenum=20'总分页数
AdoRsAry=AdoRs.getrows()
RsCount=ubound(AdoRsAry,2)
if (RsCount+1) mod pagenum<>0 and (RsCount+1)>pagenum then
pagetotal=(RsCount+1)\pagenum+1
elseif (RsCount+1) mod pagenum=0 then
pagetotal=(RsCount+1)\pagenum
else
pagetotal=1
end if
pagestr=FunCls.UDPpageshow(RsCount,pagetotal,pagenum,page)'
if page=1 then
j=0
else
j=(page-1)*pagenum
end if
if page*pagenum>rscount then
n=rscount
else
n=(page)*pagenum-1
end if
for k=j to n
startdate=FunCls.ChgDate5(AdoRsAry(0,k))
publicdate=AdoRsAry(12,k)
if trim(publicdate)="21" then
publicdate=AdoRsAry(0,k)
end if
if int(adorsary(14,k))=1 then
Commendstr=""&AdoRsAry(5,k)&""
else
If publicdate<now() Then
'Commendstr=AdoRsAry(5,k)
Commendstr="<font color=#ffff00><b>"&AdoRsAry(5,k)&"</b></font>"
Else
Commendstr="<font color=#f5b400><b>"&sflx(adorsary(10,k))&"</b></font>"
End If
end if
CommendUserName=commenduserary(adorsary(10,k)) 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询