Results 1 to 3 of 3
  1. #1
    smht is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2017
    Posts
    3

    process on sum of fields in a query

    hi
    I have a query made by a table and a query like this
    Click image for larger version. 

Name:	Untitled.png 
Views:	11 
Size:	3.7 KB 
ID:	29303
    now I want to divide sum of the third field by sum of the second field


    to follow my example it should be like this
    (20+10+25+2)/(0+10+0+2)
    how can I do that? please help me?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Make a query,Q1, to sum the columns, (use NZ(field) to convert nulls to zero)
    then make a query Q2, that uses Q1 to divide the 2 sums.

    select sum(nz(time1)), sum(nz(time2)) from table

  3. #3
    smht is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2017
    Posts
    3
    dear ranman256
    thanks for your help.
    but my problem is not turning nulls to zero
    my problem is how to work with the sums
    I have added the total row to my query but I do not know how to work with them and divide them
    is there any way to mention them (total row numbers) in VBA?

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

Similar Threads

  1. Planning Process
    By bleyden in forum Access
    Replies: 2
    Last Post: 08-09-2016, 07:31 PM
  2. What function to use this process
    By azhar2006 in forum Forms
    Replies: 2
    Last Post: 10-05-2014, 02:20 PM
  3. Ask a process amounts
    By azhar2006 in forum Queries
    Replies: 4
    Last Post: 01-14-2014, 01:06 PM
  4. Need help to simplify this process
    By shanea.kr in forum Access
    Replies: 1
    Last Post: 07-10-2012, 01:40 PM
  5. Efficient Process?
    By compooper in forum Database Design
    Replies: 1
    Last Post: 06-14-2011, 03:01 PM

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