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.
| Author |
Topic |
|
tedew
Starting Member
22 Posts |
Posted - 2005-08-05 : 09:44:59
|
hello :)i have a problem with select which should return velue in float type for example :Select (3/2) I get value 1 , but I'd Like float value - 1,5 Is it possible ??? byep.s.sorry for me English :) |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-05 : 09:48:26
|
| Select (3/2.0)MadhivananFailing to plan is Planning to fail |
 |
|
|
rheitzman
Starting Member
16 Posts |
Posted - 2005-08-05 : 13:25:46
|
| If the fields are Int try:--setup for testDECLARE @three as Int DECLARE @two as INTSELECT @three = 3SELECT @two = 2SELECT CAST(@three AS FLOAT)/CAST(@two as FLOAT) |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-06 : 01:06:32
|
| select @three/ cast(@two as float) will do the sameMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|