June 10, 2009 at 8:47 am
If I change money to numeric in the table, will I loose any data?
Thank you
June 10, 2009 at 9:01 am
Not if you specify the correct precision and scale. For example, numeric(10,2).
June 10, 2009 at 9:22 am
June 10, 2009 at 9:26 am
Robert klimes (6/10/2009)
The money type has four decimal places, so to ensure no data loss numeric(10,4) would be more appropriate.
Good catch! Missed that 🙂
June 10, 2009 at 10:47 am
Ok, I changed from money to numeric(10,4). Before data looked $967.69 and now 967.0000.What is the solution?Thank you
June 10, 2009 at 10:49 am
What's the problem?
June 10, 2009 at 10:52 am
What exactly did you do? I just ran a quick test using a temp table and had no problem.
What result does this query yield in your environment?
SELECT CAST(967.69 AS NUMERIC(10,4))
June 10, 2009 at 12:48 pm
Thank you, it is working, Can I convert float to numeric?
June 10, 2009 at 5:23 pm
Krasavita (6/10/2009)
Thank you, it is working, Can I convert float to numeric?
Numeric is a fixed-point format. When converting a floating-point format to a fixed-point format, it is always possible that you will lose some precision.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply