|
-
Jun 26th, 2003, 09:35 AM
#1
Thread Starter
Member
Help Me
Hai !
I am working with Crystal Reports 8.5 ver.
i have designed a report from a query. in the report I wanted to have a formula field. I did it and it is working fine but... there is a problem with it .... if there is a value which is blank (null) then it is not returning any value... how to rectify this?
my query data will be as follows....
AccountName --- DebitAmount --- CreditAmount
----------------- ---------------- ------------------
RaviKumar-----------10,000.00------------2,000.00
Krishna----------------3,500.00-----------11,000.00
saradhi----------------5,000.00------------------------
Prasad----------------------------------------2,500.00
Raju--------------------4,000.00------------2,000.00
In crystal report.... i made formula field named.. BALANCE.
BALANCE =
if DebitAmount > = CreditAmount then
DebitAmount - CreditAmount
else
CreditAmount - DebitAmount
while using the above thing in CR.... i got the values of BALANCE column as
AccountName --- DebitAmount --- CreditAmount --- BALANCE
----------------- ---------------- ------------------ ---------------
RaviKumar----------10,000.00------------2,000.00----------8,000.00
Krishna---------------3,500.00-----------11,000.00----------7,500.00
saradhi---------------5,000.00----------------------------------------------
Prasad----------------------------------------2,500.00----------------------
Raju-------------------4,000.00-------------2,000.00----------2,000.00
[ Have u observed the above....? ]
for 3rd and 4th record there were no values are returned.....
Please solve my problem.....
Thanks in advance...
Last edited by satyarao; Jun 26th, 2003 at 09:43 AM.
satyarao
-
Jun 26th, 2003, 09:51 AM
#2
There are several options
1) Check for Nulls in your Balance formula. Just add more if statements.
2) Create two formulas, one each for the Debit and Credit Amounts. In those formulas check for Null and return 0 otherwise return the database field. Then use these two new formulas in your Balance formula.
3) Fix your database. Don't allow Nulls in those columns.
4) Modify your query string to replace Nulls with 0.
5) In Report Options dialog (under File Menu) look at the "Change Null Value to Default". Sorry, I cannot remember the exact wording but I think its the first option.
-
Jun 27th, 2003, 01:01 AM
#3
Thread Starter
Member
Thanks
Vaaw.....
It is working perfectly... with the last one of your option. i.e. in file menu... "report options" option.
Special thanks.... to brucevde....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|