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
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Decimal in sql

Author  Topic 

SQLBoy14
Yak Posting Veteran

70 Posts

Posted - 2015-04-18 : 11:32:03
Decimal in SQL

stepson
Aged Yak Warrior

545 Posts

Posted - 2015-04-18 : 11:42:49
The type of fieldnum1 is INT ? or some kind of this
Try this :

round(fieldnum1 * 1.0/25, 2)
or
round(fieldnum1/25.0, 2)
or
round(CAST(fieldNum1 AS FLOAT) /25,2)



sabinWeb MCP
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2015-04-19 : 09:03:07
it may be that actual datatype of fieldnum would be integer which may cause it to undergo implicit conversion

see

http://beyondrelational.com/modules/2/blogs/70/posts/10825/beware-of-implicit-conversions.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2015-04-27 : 21:02:29
quote:
Originally posted by SQLBoy14

Decimal in SQL



Why are you editing your original questions and removing what you asked? It makes a mockery of the thread, and the time people spent helping you.

You have done the same thing in other threads, eg.

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=199716
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=200887
Go to Top of Page
   

- Advertisement -