Results 1 to 4 of 4
  1. #1
    dougie is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2011
    Posts
    27

    Using totals in formulas in a query

    I have a query that groups data and produces two totals for each group. A second query takes this first query as its input and divides one total by the other for each group. Is it possible to do this in one step?

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If you swtich to SQL view, you can see the SQL code behind each query. If you "nest" the code from the first query inside of the second query, then you will have it all in one query. Note that you will probably need to do this in SQL view.

  3. #3
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    Yes, in the totals line of the query where it says group by change it to expression. Then in the Field use "Column name:Sum([fieldA])/sum([fieldb])"

  4. #4
    dougie is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2011
    Posts
    27
    RayMilhon:

    Yes, I eventually figured it out.

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

Similar Threads

  1. Query Formulas
    By ShadeRF in forum Queries
    Replies: 8
    Last Post: 12-13-2011, 05:34 AM
  2. Replies: 5
    Last Post: 12-06-2011, 11:18 AM
  3. Query Formulas
    By ShadeRF in forum Queries
    Replies: 6
    Last Post: 11-15-2011, 10:45 AM
  4. Formulas
    By dunnmel4 in forum Access
    Replies: 0
    Last Post: 03-27-2011, 04:59 PM
  5. Formatting formulas
    By katrinanyc926 in forum Queries
    Replies: 2
    Last Post: 08-16-2010, 07:52 AM

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