case when EndTime is Null then '未开通过' else datediff(Day,getdate(),EndTime) end

解决方案 »

  1.   

    默认数据库选项下空值 NULL 是不能用 "=" 匹配的,要用 IS NULL 匹配。所以只能用 CASE WHEN 表达式 IS NULL THEN ... ELSE ... END 模式
      

  2.   

    改成is null以后出现这个问题
    Microsoft OLE DB Provider for SQL Server 错误 '80040e14' 在关键字 'Is' 附近有语法错误。 /HyIndex.asp,行18 
      

  3.   

    完整语句如下
    Sql="SELECT login,lastime,lastip,Point,(case EndTime when Is NULL then '未开通过' else datediff(Day,getdate(),EndTime) end) From [User] Where ID="&Session("UserID")(0)
      

  4.   

    Sql="SELECT login,lastime,lastip,Point,(case when EndTime Is NULL then '未开通过' else datediff(Day,getdate(),EndTime) end) From [User] Where ID="&Session("UserID")(0)
      

  5.   

    case EndTime when Is NULL then ... ==>  case when EndTime Is NULL then ...