剑网三代售:ASP求救?

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/01 12:36:30
这是一段读取当天过生日会员的代码:
<%
set bb=conn.execute("select * from user where Month(shengri)="&Month(now())&" and Day(shengri)="&Day(now())&" and chk='true'")
if not bb.eof then
do while not bb.eof
%>
<tr>
<td class="bottomline"><div align="center"><%=bb("xingming")%></div></td>
<td class="bottomline"><div align="center"><%=bb("xingbie")%></div></td>
<td class="bottomline"><div align="center"> </div></td>
</tr>
<%
bb.movenext
loop
end if
bb.close
set bb=nothing
%>

请哪位高人帮帮忙,怎么计算当日过生日的会员年龄

请哪位高人帮帮忙,怎么计算当日过生日的会员年龄

那你这样写呢?
<%
set bb=conn.execute("select * from user where Month(shengri)="&Month(now())&" and Day(shengri)="&Day(now())&" and chk='true'")
if not bb.eof then
do while not bb.eof
%>
<tr>
<td class="bottomline"><div align="center"><%=bb("xingming")%></div></td>
<td class="bottomline"><div align="center"><%=bb("xingbie")%></div></td>
<td class="bottomline"><div align="center"><%UserAge=Date()-bb("shengri")%><%=DatePart("yyyy",UserAge)%></div></td>
</tr>
<%
bb.movenext
loop
end if
bb.close
set bb=nothing
%>

UserAge=DateDiff("yyyy", bb("shengri"), Now)