Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2007
    Location
    Weatherford TX (Between Fort Worth and Abilene)
    Posts
    57

    Unanswered: Chart based on 2 fields

    I need to create a pic chart based on two fields and I haven't been able to figure it out.

    I have a field that shows the job number, Hours Completed, and hours remaining.

    Here is my sql

    Code:
    SELECT [Job #] ,TimeCompleted,TimeRemaining FROM dbo_vw_ReleasedJobStatusTimeRemaining
    When a user selects a job # I want to display a chart that shows a pie chart with one slice showing the timecompleted and the other showing the timeremaining.

    I guess normally with a pie chart all the data comes from one field. In this case I have data in two fields so I'm not sure how to get the result I need.

    Can someone please help me?

    I'm using access 2010
    Thanks

  2. #2
    Join Date
    Jan 2009
    Location
    Kerala, India
    Posts
    183
    You need to create three Queries to prepare the Data suitable for the PIE Chart. The SQLs are given below, copy and paste them into SQL Editing Window of new Query.

    Query Name: Query1
    Code:
    SELECT [Job #], TimeCompleted FROM dbo_vw_ReleasedJobStatusTimeRemaining;
    Query Name: Query2

    Code:
    SELECT [Job #], TimeRemaining FROM dbo_vw_ReleasedJobStatusTimeRemaining;
    Query Name: UnionQuery

    Code:
    SELECT Query1.[Job #], Query1.TimeCompleted FROM Query1
    UNION ALL
    SELECT Query2.[Job #], Query2.TimeRemaining FROM Query2;
    The result set in UnionQuery is a two column value and suitable for PIE Chart.

    Check the following links for examples of creating Charts:

    LEARN MS-ACCESS TIPS AND TRICKS - MS-Access and Graph Charts
    LEARN MS-ACCESS TIPS AND TRICKS - MS-Access and Graph Charts2
    www.MsAccessTips.com (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •