Results 1 to 3 of 3
  1. #1
    dualvba's Avatar
    dualvba is offline Novice
    Windows Vista Access 2003
    Join Date
    Apr 2012
    Location
    Kent, UK
    Posts
    18

    Calculating Totals in Query

    Hi

    I'm trying to build some queries with calculations in, and I'm not able to do what I had hoped. Am I doing it wrong?

    This is about sales.

    I'd like to firstly, be able to have a quick query, to see how many items a seller listed, with total price (this seems fine, if I count the item IDs, and sum hammer price in a query).

    And vice versa, by buyers.

    But, I'd like to sum for sellers, number of items Sold, Returned or Relisted.

    I have a status (blank for active, "sold, "relisted" or "returned", and thought, I could "count", by the status = "Sold" (ie), but it won't accept the expression.

    Ideally, for sellers, I had hoped to have one query, with total items listed, total money made, then totals for still active, sold, returned and relisted items.

    Am sure I'm doing something basic wrong, but I can't think what.



    Thank you Access guru's in advance.
    Clair

  2. #2
    DavidCunnah is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2012
    Posts
    5
    Sounds like you need a SUM(iif(condition,truevalue,nullvalue)) statement. For example, if I want to count the incidences of age = 16 it would read:

    sum(iif(person.age=16,1,0))

  3. #3
    dualvba's Avatar
    dualvba is offline Novice
    Windows Vista Access 2003
    Join Date
    Apr 2012
    Location
    Kent, UK
    Posts
    18
    Thank you so much David, I'll try that.

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

Similar Threads

  1. Calculating totals in a report
    By Jamescdawson in forum Reports
    Replies: 20
    Last Post: 06-14-2012, 02:33 PM
  2. Replies: 1
    Last Post: 06-09-2012, 05:27 PM
  3. Replies: 5
    Last Post: 12-06-2011, 11:18 AM
  4. Replies: 42
    Last Post: 07-13-2010, 02:49 PM
  5. Calculating Sub Totals in a Query
    By cassidym in forum Queries
    Replies: 2
    Last Post: 06-09-2010, 01:26 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