Link to home
Start Free TrialLog in
Avatar of bkpierce
bkpierceFlag for United States of America

asked on

SQL Reporting zero out negative numbers

I have a SQL report that has a table in it. Column C is Colum A - Column B which sometimes produces negative numbers. Is there an expression I can use to just have column C show a zero instead of negative numbers?

Column C current expression =Fields!User_Define_1.Value - Fields!Act_Labor_Units_TTD.Value
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
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
From memory, you can use IIF as follows:

Iif (Fields|User_Define_1.Value < Fields!Act_Labor_Units_TTD.Value, 0  , Fields!User_Define_1.Value - Fields!Act_Labor_Units_TTD.Value)
bkpierce,

I am puzzled.  I posted a syntactically and arithmetically identical suggestion in http:#a30119550, and posted that first, and yet you selected http:#a30119599 as the answer.

I would have been pleased with a split, but I do feel the current disposition is unfair.

Patrick
Avatar of bkpierce

ASKER

You are correct my apologies, you should have received the points as your post was first, I must have accidentally over looked it. I am not sure how to undo and assign the points to you. I'm guessing a moderator would have to be contacted?
I have contacted a moderator and asked that they make the change.
Thanks :)  I really would be pleased with a split, as chances are pretty good that Tyug and I were typing simultaneously.
Most customers want to see the neg numbers (If we are talking about money) We use brackets around our anwers in our reports to show that it is neg.