Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
datatype in table is numeric(18,0) in an insert in a sp I useconvert(decimal(8,2),InvoiceVolume/2000,0). The data inserted is an int and not a decimal. for instance if InvoiceVolume in table is 8196 what should be inserted from sp is 4.09 but instead data that inserts is 4. Any ideas. Thanks.
jimf
Master Smack Fu Yak Hacker
2875 Posts
Posted - 2013-04-11 : 10:59:49
InvoiceVolume/2000 is returning an integer first, and then you are cinverting it to decimal, all you need to do is thisconvert(decimal(8,2),InvoiceVolume*1.0/2000,0) and you should be good to go.JimEveryday I learn something that somebody else already knew
seeker62
Starting Member
40 Posts
Posted - 2013-04-11 : 11:31:32
I made suggested change and data is still 4 and not 4.09