Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SQL
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
Posted

Try:
SQL
IF CAST(@CCYR/4 AS INT) = @CCYR/4
 
Share this answer
 
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).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900