Sum 2 Columns Subtract 2 Columns If Statement?
Posted on 2011-02-28
I would like to use the results "dif" to build If Statement. Unsure how to include ">= 0" into following code.
Could need Case statement?
If sum(col1) - sum(col2 >= 0 Then continue with other code, Else don't continue
if Exists (
Select Sum(Col1) - Sum(Col2) As [diff]
Where SalesMan = 'email@example.com'
And ProductName = 'Laptop'
Group By Col1, Col2
--...continue with more code...