Results 1 to 2 of 2
  1. #1
    rsampathy is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2011
    Posts
    2

    SUM on DISTINCT FIELD

    I want to get the sum value of LIMIT on distinct value of FACID.

    Table: A1
    NAME FACID LIMIT


    =======================
    A1 F1 100
    A3 F1 100
    A2 F2 100
    A4 F5 200
    A5 F5 200
    =====================
    400=100+100+200= sum of (Limit) for unique FACID.

    Need to display this value in the form?
    Form contains all the record?
    then need to display sum of distinct FACID,LIMIT then sum.

  2. #2
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209

    SUM on DISTINCT FIELD

    Exclude the Name field to do this and create a Query with grouping on both fields. Save it with the name Query1.

    Use Query1 as input to the second Query to create the Totals. Sample SQLs are given below:

    Code:
    Query1
    
    SELECT DISTINCT [A1].FACID, [A1].LIMIT
    FROM [A1]
    GROUP BY [A1].FACID, [A1].LIMIT;
    
    Query2
    
    SELECT Query1.FACID, Sum(Query1.LIMIT) AS SumOfLIMIT
    FROM Query1
    GROUP BY Query1.FACID;

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

Similar Threads

  1. Distinct for one Column
    By crispy-bacon in forum Queries
    Replies: 2
    Last Post: 05-31-2011, 07:21 AM
  2. Replies: 1
    Last Post: 05-10-2011, 12:06 PM
  3. Need help for distinct...
    By gunapriyan in forum Queries
    Replies: 2
    Last Post: 05-28-2010, 12:18 AM
  4. Distinct Values
    By Acramer8 in forum Reports
    Replies: 1
    Last Post: 06-15-2009, 08:37 AM
  5. Counting distinct id's
    By jqljql in forum Access
    Replies: 1
    Last Post: 09-01-2006, 07:28 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