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 |
|
mauich123
Starting Member
21 Posts |
Posted - 2011-01-18 : 04:40:29
|
| HiI have a question regarding comparison. I want to compare two float columns with eachother using a WHERE-clause that specifies a value that is the minimum amount of difference in the comparisonFor example if this value = 210,01 and 10 would not be selected although12,50 and 10 would beHow would such a where-clause look like?Thanks! :) |
|
|
chris_cs
Posting Yak Master
223 Posts |
Posted - 2011-01-18 : 05:31:47
|
| You could probably just use:WHERE value1 - value2 >= 2 |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-01-18 : 06:44:45
|
Depending on how your data is structured, you may need to use absolute value, as in:where abs(value1 - value) >= 2.0 |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-01-18 : 08:45:11
|
| If the above codes do not work, post some sample data with expected resultMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|