Mar 3, 2004 #1 Waynest Programmer Jun 22, 2000 321 GB Hi (SQL 7) If, within a stored procedure, If I have a decimal(14,4) field holding 1234.5678 How do I reference the part after the decimal point? Thanks
Hi (SQL 7) If, within a stored procedure, If I have a decimal(14,4) field holding 1234.5678 How do I reference the part after the decimal point? Thanks
Mar 3, 2004 #2 collierd MIS Dec 19, 2001 509 DE You could use the round function e.g. Say variable 'pre' = 1234.5678 use: round(pre,0) - pre Damian. Upvote 0 Downvote
Mar 3, 2004 #3 SQLBill MIS May 29, 2001 7,777 US What do you mean by 'reference the part after the decimal point'? Do you mean that you just want to use the last part of the number? If so try this: DECLARE @mynumber DECIMAL(14,4) SET @mynumber = 1234.5678 SELECT @mynumber, RIGHT(@mynumber, 4) AS Without_Decimal_Point, RIGHT(@mynumber, 5) AS With_Decimal_Point -SQLBill Upvote 0 Downvote
What do you mean by 'reference the part after the decimal point'? Do you mean that you just want to use the last part of the number? If so try this: DECLARE @mynumber DECIMAL(14,4) SET @mynumber = 1234.5678 SELECT @mynumber, RIGHT(@mynumber, 4) AS Without_Decimal_Point, RIGHT(@mynumber, 5) AS With_Decimal_Point -SQLBill