Page 7 of 9 FirstFirst 123456789 LastLast
Results 91 to 105 of 132
  1. #91
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    Me neither (but there were two separate boxes for date and date by month), but I tried working out on these ROwSource's, they do the same thing but different ways but none of them work. Can you figure out why and what can be done to fix them?

    SELECT (Format([Date],"MMM 'YY")),Count([Category2]) AS [CountOfCategory2] FROM [UnionT1] GROUP BY (Year([Date])*12 + Month([Date])-1),(Format([Date],"MMM 'YY")); (Count of hours for category2 off by 100 hours)




    SELECT Sum([A1 L1] +
    A1L2 + A1L3 + A1L4 + A1L5 + [A1 Anc] + A1O) AS SumHrs
    FROM Table1
    GROUP BY
    Format([Date], "yyyymmm"); (Shows no error but no graph shows up either)



    SELECT Sum([A1 L1]), Sum(A1L2), Sum(A1L3), Sum(A1L4), Sum(A1L5), Sum([A1 Anc]), Sum(A1O)
    FROM Table1
    GROUP BY
    Format([Date], "yyyymmm");
    (Something totally different shows up, pic below)


    Attached Thumbnails Attached Thumbnails Capture.JPG  

  2. #92
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    I did not assign alias field names so Access did it for me: Expr1001, Expr1002, etc.

    I also did not show the grouping field in the SELECT clause.

    As stated, simple arithmetic with Null results in Null. If any of the terms of addition are null the result will be Null. Null does not graph.

    Adjust queries as necessary.

    Other than removing the weird expression, I don't know how to fix the wizard generated query. I have no idea why it would be off by 100 hours.
    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. #93
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    For anyone who later stumbles on this thread later I just found a work around for this problem(pic of graph below). May not be the best solution, but it works. Just create a new query with just the first five (or any number) or fields that are to be added together. I've had something liek this:

    SELECT ID, [Technician Name] AS Tech, [Date], Crew, Shift, "Line 1" As Act, [A1 L1] AS Hrs FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Line 2", [A1L2] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Line 3", [A1L3] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Line 4", [A1L4] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Line 5", [A1L5] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Ancillary", [A1 Anc] FROM Table1
    UNION SELECT ID, [Technician Name], [Date], Crew, Shift, "Other", [A1O] FROM Table1;


    Note: 'AS Act' part can be neglected though

    Go to reports>New>Chart Wizard while selecting your new query>Bar Graph> Drag Sum of Hrs box to y-axis, Date by month box to x-axis, drag the box from the main chart out so to leave it blank and Presto you are done!

    The RowSource source sql that the graph made is: SELECT (Format([Date],"MMM 'YY")),Sum([Hrs]) AS [SumOfHrs] FROM [Union6T1] GROUP BY (Year([Date])*12 + Month([Date])-1),(Format([Date],"MMM 'YY"));

    Somehow the Count operator I was using previously couldn't do the maths right!

    Dont ask me about '(Year([Date])*12 + Month([Date])-1)' part it just is a way to display month and year i guess.

    One thing I dont understand is when I am designing the graph, if I stretch it beyond a certain point it cuts itself off even if there is plenty of space(pic below) For a graph like this I want it to be as wide as possible. Workaround for this would be appreciated.
    Attached Thumbnails Attached Thumbnails Capture.JPG   Capture2.jpg  

  4. #94
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Did you resize the graph control or did you double click into the graph control and resize the graph frame?
    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.

  5. #95
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    I just double clicked into the graph and dragged the frame lines that appear. It stretches fine for some time(making the graph wider) but after a certain point it starts to cut the graph if i keep on dragging.

  6. #96
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Yep, what I suspected. Have to size both the graph control and the graph frame, and even then the results can be wonky. Lots of trial and error. And there will always be quite a bit of white space around the graph frame.
    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.

  7. #97
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    How do you size the graph control?

  8. #98
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    The same as any control. Select it, click an anchor to grab and drag.
    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.

  9. #99
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    Thanks for all your support, those graphs work and look perfectly how I had in my mind (couldn't have been possible without your help), even while stretched to fit longer sheets of paper. I hate to bring this up again, but while accessing graphs, is it possible to view graphs for a certain time-period? As in when we open those graphs, a box pops up asking from when to when should we want the data to be graphed, and after entering the data it makes the graph for the time-period specified?

  10. #100
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    I don't remember how we produced the RowSource sql for each of the graphs. If the final sql does not have a date field then somewhere in the query sequence there must be a date field that can be used to filter records. The parameter inputs can be popup prompts or reference to controls on form (I never use popups in 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.

  11. #101
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    Doesnt matter what the parameter(date) inputs are as long as it works. How do we filter the records twice, first by Technician name and then by the time period specified ('From(date)' and 'To')? Nope the sqls we used didnt have the date field :/

    For example

    Individual- Activities (As in filtered by technician name, grouped with a category)
    SELECT Category, Sum(Hrs) AS SumHrsCat FROM UnionT1 WHERE (((UnionT1.Tech)=[Forms]![Par-Pak final].[Technician Name])) GROUP BY Category;

    Total- Activities (Not filtered by technician name, just general)
    SELECT Category, Sum(Hrs) FROM UnionT1 GROUP BY Category;

    Total-Break Down troubleshooting (General with a category)
    SELECT Category2, Sum(Hrs) FROM UnionT1 WHERE Not Category2 Is Null GROUP BY Category2;

    Would be helpful if you could show me with these so I can replicate with the rest

  12. #102
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Is there a date field in UnionT1? Build criteria referencing controls on form same as done for technician.

    SELECT Category, Sum(Hrs) FROM UnionT1 WHERE [datefield] BETWEEN [Forms]![Par-Pak final].[startdate] AND [Forms]![Par-Pak final].[enddate] AND Tech=[Forms]![Par-Pak final].[Technician Name] GROUP BY Category;

    Or if the values are in textboxes on the report: [datefield] BETWEEN [tbxStartDate] AND [tbxEndDate] AND Tech = [tbxTech]
    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.

  13. #103
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    Yup! Works beautifully Though for the pop-ups the message they display is [Forms]![Par-Pak final].[startdate] and[Forms]![Par-Pak final].[enddate]. Anyway to change that to 'Start Date' and 'End Date'? Plus in the actual graph, how do I make textboxes displaying the start date and the end date for each respectively, so the person can also see afterwards what time period he is looking at.

  14. #104
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    If you have form open there should not be any popups.

    AFAIK, displaying date range in the graph would require VBA code to change graph title.

    Suggest you just use textboxes on report to display the date range. Expression in textbox would reference the form controls.

    Can change the parameters in graph RowSource to reference the report textboxes: [tbxStart] AND [tbxEnd]
    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.

  15. #105
    Sonny101 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    79
    I meant pop-up as in pop-ups to enter the date(pic below), and yeah I just wanted to use textboxes to display date range, don't know what to put as the control source for the text box though
    Attached Thumbnails Attached Thumbnails Capture.jpg  

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