SQLStr = "Update t_Online Set IsExit=1 Where IsExit=0 And DateDiff(Minute,LastUpdateTime,getdate()) > 5 " 上面的代码意思是:将LastUpdateTime和当前时间比较如果大于5分钟就把IsExit改为1,为什么不能运行呢?好象是问题出在“getdate()”,应该怎么写?

解决方案 »

  1.   

    还有这一句在本机和虚拟主机上也不能运行:
    SQLStr = "Select Top 12 a.AccountID ,Sum(a.theCount) As Counter ,b.NickName,b.Gender,c.AccountName  From t_EveryHit a,t_Character b,t_User c Where Day(a.UpdateTime) = Day(Getdate()) And  Month(a.UpdateTime) = Month(Getdate()) And a.AccountID=b.AccountID And b.AccountID=c.AccountID Group By a.AccountID,b.NickName,b.Gender,c.AccountName Order By Counter Desc"
      

  2.   

    你能确定LastUpdateTime是一个字段名吗?
    第2个问题的错误是什么?
      

  3.   

    LastUpdateTime是表t_Online 中的一个字段名,记录时间.
    第1.2个问题是同样的错误.
    好象getdate()在本机和虚拟主机上都不能运行,
    下面一段代码可以运行,把“n”改为“Minute”就不能运行,把Now()改为getdate()不能运行,错误信息是:变量未定义: 'getdate' 
    DateDiff("n",RsOnline("LastUpdateTime"),Now())