Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
select table1.val1, table2.val2,
(table1.val1-table2.val2) as mydiff,
case (table1.val1-table2.val2)/table1.val1 when < .1
then 'Yes' else 'No' end
from table1
inner join table2 on table1.key1 = table2.key2
declare @a int,@b int
select @a =120,@b=130
--select (@a/(@b*1.00)) * 100
--select (@b/(@a*1.00)) * 100
select (@a/(@b*1.00)) * 100,(@b/(@a*1.00)) * 100,case when ((@a/(@b*1.00)) * 100) < 90 or ((@a/(@b*1.00)) * 100) > 110 then 'out of range'
else 'in range' end
select @a =120,@b=140
select (@a/(@b*1.00)) * 100,(@b/(@a*1.00)) * 100,case when ((@a/(@b*1.00)) * 100) < 90 or ((@a/(@b*1.00)) * 100) > 110 then 'out of range'
else 'in range' end
Declare @T1 Table(Id Int, Value Int)
Declare @T2 Table(Id Int, Value Int)
Insert Into @T1 Values(1, 10)
Insert Into @T2 Values(1,9)
Insert Into @T1 Values(2,9)
Insert Into @T2 Values(2,10)
Select T1.Id,
T1.Value,
T2.Value,
100 * Abs(Convert(Numeric(10,2), (T1.Value - T2.Value))) / T1.Value As PercentDifference
from @T1 T1
Inner Join @T2 T2
On T1.Id = T2.Id
The best part about anything that has cheese is the cheese. So what do you think?!?George said:"Would you like cheese with that?".