ipaman
asked on
How to create a select statement with a conditional
I have the following sql:
select sum(qty * unit_cost) from table1 where id=@id
I need to revise this such that if the qty value is -1, I want to make it 1 and then multiply unit_cost
Can anyone help?
Thx,
ipaman
select sum(qty * unit_cost) from table1 where id=@id
I need to revise this such that if the qty value is -1, I want to make it 1 and then multiply unit_cost
Can anyone help?
Thx,
ipaman
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Did it work? I'm not sure it SQL Server 2005 has that function.
ASKER