value in formula


{Trans.Open_Bal} + {PrvAmt.Vasuli} - {PrvAmt.Cross} - {PrvAmt.Amt_Rcvd}
eg..
1000 + 500 - 300 - 400
Result is  800

but when value is zero than it should be display at-least any result
eg..
1000 + 0 - 0 - 0
Result shoud be 1000
but its not
formula result is nothing (empty)
LVL 1
crystal_TechAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

teedo757Commented:
Try adding quotes to 0 and see if it helps

'0'
or "0"
0
TommySzalapskiCommented:
My guess is that you don't have 0 in those, you have NULLs. NULLs mess things up. Try it like this and see if it works:
(If isnull({Trans.Open_Bal}) then 0 else {Trans.Open_Bal}) + (If isnull({PrvAmt.Vasuli}) then 0 else {PrvAmt.Vasuli})  - (If isnull({PrvAmt.Cross}) then 0 else {PrvAmt.Cross}) - (If isnull({PrvAmt.Amt_Rcvd}) then 0 else {PrvAmt.Amt_Rcvd})
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TommySzalapskiCommented:
A better way would be to do SELECT isnull(Trans.Open_Bal, 0) AS Open_Bal in the SQL query because the SQL isnull actually just replaces the null value with the second argument (0 here) so it saves a lot of typing.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

mlmccCommented:
Another way is in the formula choose the option
 DEFAULT VALUE FOR NULL rather than EXCEPTION FOR NULL

mlmcc
0
mlmccCommented:
Is this using CR 7?

If so then the NULL test is  the only way to go unless you can build a query in the database.

There is a report level option to use a default value for NULL.  That will work but it also substitutes default value for the NULL fields which can cause other issues.

mlmcc
0
TommySzalapskiCommented:
I assumed it was CR 7 since that's what was tagged that's why I suggested the NULL test and the query change.
0
crystal_TechAuthor Commented:
Thanks TommySzalapski:
your suggested NULL test is working

(If isnull({Trans.Open_Bal}) then 0 else {Trans.Open_Bal}) + (If isnull({PrvAmt.Vasuli}) then 0 else {PrvAmt.Vasuli})  - (If isnull({PrvAmt.Cross}) then 0 else {PrvAmt.Cross}) - (If isnull({PrvAmt.Amt_Rcvd}) then 0 else {PrvAmt.Amt_Rcvd})

and  your suggested query is also working with one of my another problem.
SELECT isnull(Trans.Open_Bal, 0) AS Open_Ba

Thanks Again
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.