|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
What data type should I use???
I am trying to divide two numbers in a user defined function that returns a decimal(3,3)
example. 2/4 should have a result of .500 All i'm getting back is .000. I tried using CONVERT(decimal(3,3),(2/4)) to get the result I am after. I get the same result: 0.000 Thanks |
|
#2
|
||||
|
||||
|
Never mind I got it
You need to declare one of the numbers in the division statement as a decimal select ((CAST(2 AS DECIMAL(3,2))/4)) |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > What data type should I use??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|