UPDATE TB SET  折旧金额=(GETDATE()- 购买时间)*折旧率*购买金额

解决方案 »

  1.   

    create procedure Update_TB()
    as
    Update UPDATE TB SET 折旧金额=(GETDATE()- 购买时间)*折旧率*购买金额
    where ‘条件自己加吧’
    go
      

  2.   

    服务器: 消息 403,级别 16,状态 1,过程 Update_TB,行 3
    对数据类型而言运算符无效。运算符为 multiply,类型为 datetime
    报错请问如何转换,谢谢!!!
      

  3.   

    create procedure Update_TB
    as
    Update  TB SET 折旧金额=datediff(dd,购买时间,getdate())*折旧率*购买金额go
      

  4.   

    恩,统一楼上的,不过在语句的最后加个end 或者 return