How do I add values from two seperate querys in SQL
- by fishhead
Below is my attempt at addinf two values from seperate select statments...it's not working...I can't see why. Looking for some direction
thanks
select (v1.Value + v2.Value) as total from
(
(Select Max(Value) as [Value] from History WHERE
Datetime>='Apr 11 2010 6:05AM' and Datetime<='Apr 11 2010 6:05PM'
and Tagname ='RWQ272017DTD' ) as v1
(Select Max(Value) as [Value] from History WHERE
Datetime>='Apr 11 2010 6:05AM' and Datetime<='Apr 11 2010 6:05PM'
and Tagname ='RU282001DTD' ) as v2
)
boy do I feel foolish...I asked the same question a few days ago...now I can't delete this.