Results 1 to 7 of 7
  1. #1
    aneshskmr is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    4

    Question how to find sum

    i need to find sum of three or more fieds in a table ...



    Click image for larger version. 

Name:	Capture.jpg 
Views:	17 
Size:	58.2 KB 
ID:	18678

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    I would suggest creating a query based on the table. Then create a calculated field with an expression, something like:
    Total Absence:[Field1] + [Field2] + [Field3]
    Replace Field1, 2 and 3 with the actual names of your fields.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    aneshskmr is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    4
    no use boss

    Click image for larger version. 

Name:	Capture.JPG 
Views:	13 
Size:	64.4 KB 
ID:	18692

    Click image for larger version. 

Name:	2.JPG 
Views:	13 
Size:	66.0 KB 
ID:	18693
    i want knw abt how find sum of three field



    Quote Originally Posted by Bob Fitz View Post
    I would suggest creating a query based on the table. Then create a calculated field with an expression, something like:
    Total Absence:[Field1] + [Field2] + [Field3]
    Replace Field1, 2 and 3 with the actual names of your fields.

  4. #4
    thebigthing313 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    119
    Bob Fitz's solution works, but he assumed that your fields were number fields. The results in the "Total" indicate that those fields are stored as Text Fields. You will either have to change the design of the table to make them number fields or you will have to replace the function with:

    Code:
    Total: Val([field1]) + Val([field2]) + ...
    Quick suggestions, your field names may cause problems in the future as you work on this database. You may want do some research on naming conventions.

  5. #5
    aneshskmr is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    4

    Thumbs up

    thank u boss its working ,,,but if any field empty not get answr,,,, do u hav any solution 4 dis problem??



    Quote Originally Posted by thebigthing313 View Post
    Bob Fitz's solution works, but he assumed that your fields were number fields. The results in the "Total" indicate that those fields are stored as Text Fields. You will either have to change the design of the table to make them number fields or you will have to replace the function with:

    Code:
    Total: Val([field1]) + Val([field2]) + ...
    Quick suggestions, your field names may cause problems in the future as you work on this database. You may want do some research on naming conventions.

  6. #6
    thebigthing313 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    119
    Is there a reason you are not using number fields? This would all be much easier if you converted them.

    Nonetheless, if you keep everything the same, then there's a slight complication since your fields can hold a NULL or a zero-length string. You can try:

    Code:
    Total: Val(Nz([Field1],0)) + Val(Nz([Field2],0)) + ...

  7. #7
    aneshskmr is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    4
    thank u very much boss...

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums