Link to home
Start Free TrialLog in
Avatar of Charles Baldo
Charles BaldoFlag for United States of America

asked on

Need Stored Procedure that adds only when matching column is true

Hello

I have 5 columns in a database with a value

val1
..
..
..
val5

and 5 matching bit columns

ValBit1
..
...
..
ValBit5


I need to sum up the values in val1 only when Valbit1 is true Val2 when Val2 is true etc etc

all returning 1 summed value

I need to do this is a stored procedure not sure how to proceed?

Thanks


ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Charles Baldo

ASKER

Thank You all