Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    I am able to get a chart control to work.



    I created a query ConsultationsChart:
    SELECT Nz([Year],"None") AS YearCPT, Nz([ProvideName],"None") AS Provider, T_ProcedureCode.CPT, Sum(Nz([N],0)) AS SumOfN
    FROM T_ProcedureCode LEFT JOIN T_CPT ON T_ProcedureCode.CPT = T_CPT.CPT
    GROUP BY Nz([Year],"None"), Nz([ProvideName],"None"), T_ProcedureCode.CPT
    HAVING (((T_ProcedureCode.CPT)<"99206"));

    Then the RowSource for chart control:
    SELECT CPT, SumOfN FROM [ConsultationsChart] WHERE [YearCPT]=[Year] AND [Provider]=[ProvideName];
    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.

  2. #17
    Ray67 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    338
    June 7

    Can you send me a copy of the db? I try it over here and it still doesn't show CPT with null value on the chart. It is showing me the one's with value.

    Thank you

  3. #18
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Right, the 'null' records chart will be blank unless you handle the nulls in the report RecordSource same way I handled them in the chart query. Create the YearCPT and Provider fields in the report query. Then change the chart RowSource to reflect those names in the WHERE clause.
    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.

  4. #19
    Ray67 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    338
    The report is a crosstab query. How would i handle field N??? SumOfN: Sum(Nz([N],0))
    I was able to create YearCPT and Provider fields.

  5. #20
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Yes, that should work, just like I did in the chart query.
    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.

  6. #21
    Ray67 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    338
    Ok i try it but it doesn't give me Nulls. The report is by month not by year.
    Here is the SQL
    TRANSFORM Sum(Nz([N],0)) AS SumOfN
    SELECT Nz([Year],"None") AS YearCPT, Nz([ProvideName],"None") AS Provider, T_CPT.CPT
    FROM T_CPT, T_ProcedureCode
    WHERE (((T_CPT.CPT)="99211" Or (T_CPT.CPT)="99212" Or (T_CPT.CPT)="99213" Or (T_CPT.CPT)="99214" Or (T_CPT.CPT)="99215" Or (T_CPT.CPT)="99201" Or (T_CPT.CPT)="99202" Or (T_CPT.CPT)="99203" Or (T_CPT.CPT)="99204" Or (T_CPT.CPT)="99205" Or (T_CPT.CPT)="99241" Or (T_CPT.CPT)="99242" Or (T_CPT.CPT)="99243" Or (T_CPT.CPT)="99244" Or (T_CPT.CPT)="99245"))
    GROUP BY Nz([Year],"None"), Nz([ProvideName],"None"), T_CPT.CPT
    PIVOT T_CPT.Month In ('January','February','March','April','May','June' ,'July','August','September','October','November', 'December');

  7. #22
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Q_CPTCountChart:
    TRANSFORM Sum(Nz([N],0)) AS SumOfN
    SELECT Nz([Year],"None") AS YearCPT, Nz([ProvideName],"None") AS Provider, T_ProcedureCode.CPT
    FROM T_CPT RIGHT JOIN T_ProcedureCode ON T_CPT.CPT = T_ProcedureCode.CPT
    WHERE (((T_ProcedureCode.CPT)<"99206"))
    GROUP BY Nz([Year],"None"), Nz([ProvideName],"None"), T_ProcedureCode.CPT
    PIVOT T_CPT.Month In ('January','February','March','April','May','June' ,'July','August','September','October','November', 'December');

    ConsultationsChart:
    SELECT Nz([Year],"None") AS YearCPT, Nz([ProvideName],"None") AS Provider, T_ProcedureCode.CPT, Sum(Nz([N],0)) AS SumOfN
    FROM T_ProcedureCode LEFT JOIN T_CPT ON T_ProcedureCode.CPT = T_CPT.CPT
    GROUP BY Nz([Year],"None"), Nz([ProvideName],"None"), T_ProcedureCode.CPT
    HAVING (((T_ProcedureCode.CPT)<"99206"));

    Q_CPTTConsultationsChart:
    SELECT Nz([Year],"None") AS YearCPT, Nz([ProvideName],"None") AS Provider, T_CPT.Month, T_ProcedureCode.CPT, Sum(Nz([N],0)) AS SumOfN
    FROM T_ProcedureCode LEFT JOIN T_CPT ON T_ProcedureCode.CPT = T_CPT.CPT
    GROUP BY Nz([Year],"None"), Nz([ProvideName],"None"), T_CPT.Month, T_ProcedureCode.CPT
    HAVING (((T_ProcedureCode.CPT)<"99206"));

    Chart RowSource:
    SELECT CPT, SumOfN FROM [ConsultationsChart] WHERE [YearCPT]=[Year] AND [Provider]=[ProvideName];

    Fix the expression for the ProvideName group. Fix textboxes ControlSource. Fix the Master/Child links for the subform or remove the subform.
    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.

  8. #23
    Ray67 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    338
    Thank you very much for you help.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. New Database or New Category?
    By GCS in forum Access
    Replies: 3
    Last Post: 08-13-2012, 01:59 PM
  2. Query for each category
    By snowboarder234 in forum Queries
    Replies: 1
    Last Post: 07-03-2012, 01:52 PM
  3. Category redesign
    By squirrly in forum Database Design
    Replies: 16
    Last Post: 12-13-2011, 06:32 PM
  4. Replies: 2
    Last Post: 07-12-2010, 05:39 AM
  5. Chart doesn't show data
    By pbaxter in forum Forms
    Replies: 5
    Last Post: 01-20-2010, 11:09 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