求字段平均值:
<%
Sql1="SELECT AVG(Kscj) as pjdh From ndpxksqk "
Set ObjRs = ObjAdo.OpenRs(Sql1)
%>
<%=ObjRs("pjdh")%>
保留小数点后两位数:
FormatNumber(c,2,-2)
'c为字段或变量
Access数据库SQL查带有日文的信息时,把like替换一下:
InStr(1,D_Title,'"&s_keyword&"',0)
过滤<a>标签
Function RemoveHTML(str)
Dim re
Set re=New RegExp
re.Pattern="<[a|A]+[^>]*>"
re.IgnoreCase=True
re.Global=True
str=re.Replace(str,"")
Set re=Nothing
RemoveHTML=str
End Function
strContent=RemoveHTML(strContent)
strContent=replace(strContent,"</a>","",1,-1,1)
reponse.write strContent |