Results 1 to 3 of 3
  1. #1
    MAABDOLAT is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    3

    Query Problem

    Dear All,

    I want to make a query but cant able to do that, plz help.....

    I have 2 tables and i want to make a query to sum values...



    Detail:

    Sales Payment Query Result
    SNO BID PID SNO Total Paid BID Total Paid
    1 222 1 1 1000 500 222 3900 750
    2 555 2 3 500 200 333 7300 4500
    3 333 3 4 900 250 555 5000 5000
    4 222 4 4 2000 0
    5 333 5 5 3000 1000
    6 3 2000 2000
    7 3 100 100
    8 5 500 50
    9 5 1000 950
    10 5 200 200
    11 2 5000 5000



    Kindly give me query to solve the issue....

    regards,

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    This is really a basic query.
    Use Access query designer to build an aggregate query.
    Join tables on SNO fields. Pull SNO, Total, Paid fields to field grid.
    Click TOTAL (Sigma) button on Design tab.
    GROUP BY under SNO field, SUM function under Total and Paid fields.

    Alternatively, build a report and use its Sorting & Grouping feature with aggregate calcs in textboxes. This will allow displaying detail data as well as summary calcs.

    Cross post https://www.access-programmers.co.uk...roblem.320187/
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Code:
    SELECT Sales.BID, Sum(Payment.Total) AS SumOfTotal, Sum(Payment.Paid) AS SumOfPaid
    FROM Sales INNER JOIN Payment ON Sales.SNO = Payment.SNO
    GROUP BY Sales.BID;

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

Similar Threads

  1. Query problem in VBA
    By RayMilhon in forum Programming
    Replies: 5
    Last Post: 11-18-2016, 06:07 PM
  2. Update Query Problem (Not an Updateable Query)
    By McArthurGDM in forum Queries
    Replies: 6
    Last Post: 02-19-2015, 11:25 AM
  3. Problem with query
    By shultzcarla in forum Access
    Replies: 8
    Last Post: 10-16-2012, 02:26 PM
  4. Query Problem
    By Swinton in forum Queries
    Replies: 1
    Last Post: 10-27-2010, 09:47 PM
  5. query problem i have a problem wi
    By maxx3 in forum Queries
    Replies: 0
    Last Post: 06-29-2009, 02:29 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