Page 4 of 9 FirstFirst 123456789 LastLast
Results 46 to 60 of 132
  1. #46
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    No no what I meant was a piechart not restricted to one technician only, but the total hours put into that activity by the workforce. So it shouldn't be categorized by the technician names but the sum of all the manhours put in by all the technicians for a particular category.

  2. #47
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    So a exact same pie-chart but unlike the one attached (which is of a particular Technician) but for the total manhours put in the category by the workforce.
    Attached Thumbnails Attached Thumbnails Capture.JPG  

  3. #48
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    Then change the RowSource sql as appropriate for the grouping you want.

    SELECT Category, Sum(Hrs) FROM table GROUP BY Category;
    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. #49
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    yup got it

    SELECT Category, Sum(Hrs) FROM UnionT1 GROUP BY Category;

    Can I make one more category in the query, so then I can categorize the fields differently, without messing up with the original category? So what I mean to say is that I want to make another general Pie-Chart for A1 (A1L1, A1L2, A1L3 etc), not specified to any technician, but a total distribution of manhours.

  5. #50
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    Don't really understand the question.

    Add fields to the UNION as you see fit.

    Make as many pie charts as you want, each with their own RowSource.
    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. #51
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    umm something along the lines of:

    SELECT ID, [Technician Name] AS Tech, [Date], Crew, Shift, "Break Down Troubleshooting" AS Category, "Line 1" AS Category2, "A1L1" As Act, [A1 L1] AS Hrs FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Line 2", "A1L2", [A1L2] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Line 3", "A1L3", [A1L3] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Line 4", "A1L4", [A1L4] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Line 5", "A1L5", [A1L5] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Ancillary", "A1 Anc", [A1 Anc] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", "A2L1", [A2L1] FROM Table1


    Then Row sql to be:

    SELECT Category2, Sum(Hrs) FROM UnionT1 GROUP BY Category2;

  7. #52
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    Yes, you got it. Test it. Showing what you want?
    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. #53
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    Doesnt work Got an error saying "The number of columns in the two selected tables or queries of a union do not match"


    Full code:

    SELECT ID, [Technician Name] AS Tech, [Date], Crew, Shift, "Break Down Troubleshooting" AS Category, "Line 1" AS Category2, "A1L1" As Act, [A1 L1] AS Hrs FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Line 2", "A1L2", [A1L2] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Line 3", "A1L3", [A1L3] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Line 4", "A1L4", [A1L4] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Line 5", "A1L5", [A1L5] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Ancillary", "A1 Anc", [A1 Anc] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", "A2L1", [A2L1] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", "A2L2", [A2L2] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", "A2L3", [A2L3] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", "A2L4", [A2L4] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", "A2L5", [A2L5] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", "A2 Anc", [A2 Anc] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Maintenance /Improv", "Inventory", [A3 Inv] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Maintenance /Improv", "Shop", [A3 Shop] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Maintenance /Improv", "Facility", [A3 Facility] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Maintenance /Improv", "Housekeeping", [A3 Housekeeping] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Assigned Project", "Installation", [A4 Installation] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Assigned Project", "Preparation", [A4 Preparation] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Self-Improvement Activity", "Discussion", [A5 Discuss] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Self-Improvement Activity", "Inspection", [A5 Inspec] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Self-Improvement Activity", "Manual", [A5 manual] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Other Activity", "Other(Specified)", [A5 Specify] FROM Table1;

  9. #54
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    Did not continue the "Line 1", "Line 2", etc for Category2 on all rows.
    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.

  10. #55
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    I only want the first six entries for the graph

  11. #56
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    Doesn't matter, each row must have same number of fields. Put some value or use Null.

    ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", Null, "A2L1", [A2L1] FROM Table1
    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.

  12. #57
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    Ok I wrote this code:

    SELECT ID, [Technician Name] AS Tech, [Date], Crew, Shift, "Break Down Troubleshooting" AS Category, "Line 1" AS Category2, "A1L1" As Act, [A1 L1] AS Hrs FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Line 2", "A1L2", [A1L2] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Line 3", "A1L3", [A1L3] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Line 4", "A1L4", [A1L4] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Line 5", "A1L5", [A1L5] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Break Down Troubleshooting", "Ancillary", "A1 Anc", [A1 Anc] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", Null, "A2L1", [A2L1] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", Null, "A2L2", [A2L2] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", Null, "A2L3", [A2L3] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", Null, "A2L4", [A2L4] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", Null, "A2L5", [A2L5] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Preventative Maintenance", Null, "A2 Anc", [A2 Anc] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Maintenance /Improv", Null, "Inventory", [A3 Inv] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Maintenance /Improv", Null, "Shop", [A3 Shop] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Maintenance /Improv", Null, "Facility", [A3 Facility] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Maintenance /Improv", Null, "Housekeeping", [A3 Housekeeping] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Assigned Project", Null, "Installation", [A4 Installation] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Assigned Project", Null, "Preparation", [A4 Preparation] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Self-Improvement Activity", Null, "Discussion", [A5 Discuss] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Self-Improvement Activity", Null, "Inspection", [A5 Inspec] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Self-Improvement Activity", Null, "Manual", [A5 manual] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Other Activity", Null, "Other(Specified)", [A5 Specify] FROM Table1;


    With this row sql:

    SELECT Category2, Sum(Hrs) FROM UnionT1 GROUP BY Category2;

    But got a piechart with all the six categories that I want, PLUS a huge "slice 1". I think that is because of that Null, and it sums all the "Null" categories. Any ideas?
    Attached Thumbnails Attached Thumbnails Capture.JPG  

  13. #58
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    SELECT Category2, Sum(Hrs) FROM UnionT1 WHERE Not Category2 Is Null GROUP BY Category2;
    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.

  14. #59
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    Oh nice! That works Is there anyway to make a overall bar-graph of a certain category (A1L1, A1L2, A1L3,... A1 Anc) with total hours in the y-axis, and the x-axis displaying the last 12 months, so the bar-graph displays the total number of hours worked in each month, but (here's the tricky part) the months should cycle and be restricted to last 12 months only. So lets say it is Aug now, and for this month the x-axis should go from this Aug to last years Sep, and when Sep comes, the x-axis should go from this Sep to last years Oct (discarding the last month as time progresses). I know its kinda confusing but it would be great if you could help me out with it.


    Something like this (for for 12 months)
    Attached Thumbnails Attached Thumbnails Untitled.png  

  15. #60
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    Rolling time period is complicated. I have one db that produces a report that 'rolls' the days/weeks for a 2 week period (time and attendance). Never thought about graphing.

    Here is file.

    Ooops! Just found an error on the report for calculating days of the second week. See if you can find it.
    Attached Files Attached Files
    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.

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

Similar Threads

  1. Graph on Form - Overriding data
    By Gabriel2012 in forum Forms
    Replies: 6
    Last Post: 02-19-2013, 10:18 AM
  2. Replies: 6
    Last Post: 02-29-2012, 03:13 AM
  3. How to program a GRAPH out of data from TABLE
    By taimysho0 in forum Programming
    Replies: 7
    Last Post: 02-15-2012, 04:09 PM
  4. Replies: 3
    Last Post: 01-10-2011, 10:31 AM
  5. Graph totals queries with different data
    By maggioant in forum Queries
    Replies: 0
    Last Post: 10-01-2009, 12:12 PM

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