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.
ok. Here's one that is so simple, that i can't find the answer :DSelect 5/2 gives 2, but I want to get 2.5 as an result.Does someone know the answer for this guru question?thx
smccreadie
Aged Yak Warrior
505 Posts
Posted - 2002-09-15 : 07:02:29
You need to use a datatype that allows precision to get the correct answer. If the 5 and 2 are integers, dividing them will give you 2. For example: