INT功能问题 [英] Problem with the INT function

查看:74
本文介绍了INT功能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的专家,

问题检查计算 ms sql server 2008 存储 procedure INT function


IF INT (@ CCYR / 4)= @ CCYR / 4

BEGIN
SET @ FDAY = 29
END


错误消息

' INT' 一个公认的内置功能名称。



请帮助

解决方案

尝试:

  IF  CAST(@ CCYR / 4  AS   INT )= @ CCYR / 4 


作为替代方案,您可以使用 modulo operator [ ^ ]



请注意,您在2月份分配 29 天的规则已被破坏(世纪年不是闰年,除非它们也可以被 400 )。

Dear Expert,

having problem checking and calculating in ms sql server 2008 stored procedure with the INT function


IF INT(@CCYR/4)= @CCYR/4

BEGIN
SET @FDAY=29
END


Error message

'INT' is not a recognized built-in function name.



Pls assist

解决方案

Try:

IF CAST(@CCYR/4 AS INT) = @CCYR/4


As an alternative, you might use the modulo operator[^] %.

Please note, your rule for assigning 29 days to february is broken (century years are not leap years unless they are also divisible by 400).


这篇关于INT功能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆