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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Subtraction in Float

Author  Topic 

sanjay5219
Posting Yak Master

240 Posts

Posted - 2010-10-13 : 13:25:17
Dear All,

I am trying this query and getting 0 but actually value should come
Please help

Update Table set OP=convert(float,CA)-Convert(Float,PA)
OP is float
CA is float
PA is float
i tried below query and getting same 0 value

Update Table set OP=CA-PA

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-13 : 13:52:57
Do you have example values?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2010-10-14 : 05:28:56
Why are you using float? Float is uses what is called appoximation for and could leave you with inaccurate results. Use decimal instead...

- Lumbago

My blog (yes, I have a blog now! just not that much content yet)
-> www.thefirstsql.com
Go to Top of Page
   

- Advertisement -