asp帮我看看这段代码哪里错了

来源:百度知道 编辑:UC知道 时间:2024/06/05 09:38:40
<%
HtmlTop
if CookieUserName=empty then error("您还未<a href=""Login.asp"">登录</a>论坛")
LastGetMoneyTime=Conn.Execute("Select GetMoneyTime from [BBSXP_Users] Where UserName='"&CookieUserName&"'")(0)
If Request("Menu")="GetMoney" then
If DateDiff("d", LastGetMoneyTime, Date())>1 then
Conn.Execute("update [BBSXP_Users] set UserMoney=UserMoney+50,GetMoneyTime=Date() where UserName='"&CookieUserName&"'")
Alert("成功领取50个金币的奖励")
Else
Alert("您已经领取过奖励了")
End If
End If
%>
出现的错误是,已经过了凌晨12点,也就是第二天了,还是提示已经领取过奖励了,请告诉我错在哪里,非常感谢
DateDiff等于领取奖励的时间啊,

response.write DateDiff("d", LastGetMoneyTime, Date())
response.end

看看这个DateDiff到底等于多少

有可能语句应该是If DateDiff("d", LastGetMoneyTime, Date())>=1 then

C语言字典里看看·

把那句DateDiff("d", LastGetMoneyTime, Date()) 改成
DateDiff("d", LastGetMoneyTime, Now()) 试下看