Results 1 to 4 of 4
  1. #1
    TWheatley is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2012
    Posts
    2

    Help with a report query

    Hey guys, I am new to Access. I want to get a report from a database and I have no idea where to begin. I need the report to look like this:

    INSURANCE COVERAGE SUMMARY REPORT

    Insurer Service NumberCovered CostCovered

    GreatWest Life

    Cleaning 14 7550
    Extraction 5 500
    Filling 10 1500

    Insurer Total 9550
    Canada Life

    Cleaning 22 13250
    Extraction 16 7250
    Chat 22 25000

    Insurer Total 45500



    Report Total 70500

    So far my pseudo code is this:

    Code:
    SELECT p_insurer, s_name, SUM(as_quantity), SUM(as_quantity * s_costperunit)
    FROM person, service, app_svc, appointment
    GROUP BY p_insurer, s_name
    Basically I am wondering how to properly use the SUM properties, and how to get them to only sum the quantities of each service. I have four tables: appointments, service, person, and one the links appointments with the services requested. Any help you guys can give would be appreciated.

    Also here is my table view of my databases:

    Click image for larger version. 

Name:	Database.jpg 
Views:	14 
Size:	70.5 KB 
ID:	10302

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    For starters, you need joins between your tables. If you create the query in design view, Access should add them for you since you have relationships set up.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    TWheatley is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2012
    Posts
    2
    Any chance I could be pointed in the right direction with the SQL script for it?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Here's an example from a db I have open:

    SELECT tblReservations.ResNum, tblReservations.ReqDateTime, tblCarTypes.CarDesc
    FROM tblReservations INNER JOIN tblCarTypes ON tblReservations.CarType = tblCarTypes.CarType;
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Sub report of a complex query/report
    By roar58 in forum Reports
    Replies: 1
    Last Post: 03-11-2012, 08:41 PM
  2. Replies: 1
    Last Post: 07-15-2011, 10:59 PM
  3. Report based on query + sub-report (1:N relation)
    By BayerMeister in forum Reports
    Replies: 1
    Last Post: 08-19-2010, 03:26 AM
  4. Replies: 3
    Last Post: 05-21-2010, 03:57 PM
  5. Replies: 1
    Last Post: 02-02-2009, 05: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