Home Forums SQL Server 2008 SQL Server 2008 - General Subtract value in one record from another RE: Subtract value in one record from another
Mark Eckeard
Hall of Fame
Points: 3462
More actions
November 26, 2013 at 5:51 am
#1669103
Hard to say w/o your schema and sample data but would this work?
select (T1.HB-T2.HB) as CalcValue
from SampleResults T1
inner join SampleResults T2
on T1.SubjectNumber = T2.SubjectNumber
where T1.SampleType = 1
and T2.SampleType = 3
Mark