![]() |
|
|
#1
|
|||
|
|||
|
Hi All,
I am new to this forum and sending my first post where I am facing a small issue in summing two number fields. Field1 : Data Type: Number Format: Single Decimal :2 Ex: 21.12 Field2 : Data Type: Number Format: Single Decimal :2 Ex:19.23 I placed a text box in the report to sum field 1 and field 2 and put the result in textbox(=[field1]+[field2]) The report is dispalying the total(40.35) when both the fields are having values,but showing blank when one of the field value is blank. Any ideas how to resolve this issue. Thanks in Advance. |
|
#2
|
|||
|
|||
|
=nz([field1],0)+nz([field2],0)
|
|
#3
|
|||
|
|||
|
Hello Rain,
Thanks for the reply,now I am able to get the sum when only one value is there out of two.I have placed the expression you have given in the controlsource of Total field. I tested the report with different values in the field1 and field2. Please find the results below. Test1 Field1 : 22.52 field2: 21.2 Total: 43.72 (Correct) Test2 Field1:blank Field2: 21.2 Total: 21.2000001(Should be 21.2 - how to correct this?) Test3 Field1:15.62 Field2: blank Total: 15.62(correct) The only issue is with test2 result. Below are the definitions and properties I have set at Table level and report level. Table Level Definitions Field1 : Data Type: Number Format: Single Decimals:2 Ex: 21.12 Field2 : Data Type: Number Format: Single Decimals:2 Ex:19.23 Report level Definitons Field1 : Format: General Number Decimals:2 Field2 : Format: General Number Decimals:2 Total: Format: General Number Decimals:2 Please let me know if any property of the Field1,field2 and Total has to be changed. |
|
#4
|
|||
|
|||
|
You just need to format the result to 2 Decimal Places.
Also if you only require 2 Decimal places then I would use Currency and format it not to show the Dollar sign. |
|
#5
|
|||
|
|||
|
Thanks Rain,
The sum is working fine. I set the total field format as standard with two decimals. |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Urgent issue! Create field for intervals | Bjorn | Queries | 3 | 02-10-2010 07:26 AM |
| query field with multiple values | mknowles | Queries | 1 | 11-24-2009 08:31 AM |
| How to write field values next to each other? | Petefured | Programming | 2 | 09-23-2009 12:39 PM |
| summing values associated with date ranges | wdemilly | Reports | 0 | 07-17-2009 11:53 AM |
| clear field values | surrendertoo | Queries | 0 | 02-23-2008 07:57 PM |