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 |
|
noamg
Posting Yak Master
215 Posts |
Posted - 2006-05-29 : 10:49:04
|
| how to know if an expresion's result is a simple integer value or has any value after the float point ?for example:SET @c = Sqrt( @a / @b )Is @c has something after the float point or maybe it is a nice integer ?any idea ?Noam Graizer |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-29 : 10:51:50
|
| It depends on the datatype of @cDeclare @a int, @b int, @c floatselect @a=10, @b=5SET @c = Sqrt( @a / @b )select @cGoDeclare @a int, @b int, @c intselect @a=10, @b=5SET @c = Sqrt( @a / @b )select @cMadhivananFailing to plan is Planning to fail |
 |
|
|
noamg
Posting Yak Master
215 Posts |
Posted - 2006-05-29 : 10:53:07
|
| declare @c decimal(28,10)how to know if @c includes some value after the point ?Noam Graizer |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-29 : 10:59:02
|
| [code]if ceiling(@c)= floor(@c) Print 'Integer'else Print 'Non integer'[/code]MadhivananFailing to plan is Planning to fail |
 |
|
|
noamg
Posting Yak Master
215 Posts |
Posted - 2006-05-29 : 11:03:47
|
| GREAT !thanks, i didn't think ...Noam Graizer |
 |
|
|
|
|
|