Results 1 to 5 of 5
  1. #1
    spyldbrat is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2015
    Posts
    73

    Need Help Creating a Query

    I have 2 spreadsheets:

    This first shows violations. This spreadsheet has duplicate names on it and additional names (some new and some duplicate) will be added on a daily basis.
    Beg Date End Date Employee Number First Name Middle Name Last Name Category Sub Cat Minutes Note Excused Week Day Violation Date Hire Date Supervisor Points Date Notified of Weekly Points
    08/02/15 08/02/15 10908 FN 1 R LN 1 Other (See Notes) Forgot to Clock In/Out 0.00996 Notes FALSE Sunday 08/02/15 04/11/06 PA Guards 1
    08/02/15 08/02/15 16737 FN 2 R LN 2 No Call No Show No Call No Show 6.00 Notes TRUE Sunday 08/02/15 10/02/13 PA Guards 15
    08/02/15 08/02/15 19018 FN 3 R LN 3 No Call No Show No Call No Show 6.00 Notes FALSE Sunday 08/02/15 07/29/15 PA Guards 15
    08/02/15 08/02/15 18820 FN 4 R LN 4 Late Late:Fri to Sun 31 to 60 Min 0.45 Notes FALSE Sunday 08/02/15 06/12/15 NY Guards 3.5

    The second is Pivot table which looks at the above and summarizes the amount of violations and total points for each person:
    EEN Last Name # of Violations Total Points
    10908 LN1 1 1
    16737 LN2 1 15
    19018 LN3 1 6
    18820 LN4 2 15


    I need to summarize the number of the points & the #of violations for each employee on a third sheet (below), but also maintain the existing information for each employee recorded in all the columns below after the "Total Points" (starting with Verbal [Date Written]). The last 15 columns would be manually updated.


    EEN First Name Last Name # of Violations Total Points Verbal (Date Written) Points @time of Verbal Verbal (Date Counseled) Written (Date Written) Points @time of Written Written (Date Counseled) Final (Date Written) Points @time of FINAL Final (Date Counseled) Susp(Date Written) Points @time of SUSP Susp (Date Counseled) Term (Date Written) Points @time of TERM Term (Date Counseled)
    10908 FN 1 LN 1 1 1 08/01/15 1 08/02/15
    16737 FN 2 LN 2 1 15 08/06/15 15
    19018 FN 3 LN 3 1 6 08/05/15 6
    16737 FN 3 LN 3 2 15 08/01/15 8 08/02/15 08/08/15 15

    I was thinking I could create a cross tab for the first sheet and a regular query for the second sheet and then create a third Query which would somehow yield the results I need to see on the third sheet. However, when I tried creating a crosstab for the first sheet to summarize all the employee's, it did not come out correctly. Also, I am not exactly sure what I would need to do update the third sheet while maintaining the last 15 columns information to each employee?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    try a query, joining the table1, and pivot , join on EEN.
    bring down all fields

  3. #3
    spyldbrat is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2015
    Posts
    73
    I am sorry but Access is a fairly new program for me to use (and I def struggle using it) so I am not fully understanding what you are saying. Can you break it down for in a little more detail?

  4. #4
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    You have data structure issues. Which is very common between excel based info versus a database. Nothing really to do with Access specifically. Your 2nd table is a summary or aggregate table I believe. Your 3rd table is a problem with that excel left-to-right style lay out. In a database all those fields that are shaded, you would instead have just 1 generically named field: Step (or maybe Stage or something appropriate) and then each of those headings would be a fill list that is a drop down selector where you would select the stage and then enter date. So each is a row.

    Starting from new would not be a problem but attempting a transform from excel data into database structure would be a bigger task - not unreasonable for a 1 time effort to initially populate a database - but not something that you want to have to repeat over and over.

  5. #5
    spyldbrat is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2015
    Posts
    73
    When I did what ranman256 suggested, it was not pulling all the data (which was one of the problems I was having). I ended joining all 3 tables. When I run the Query, it is pulling all the data but for anyone who is on the first table more than once, it is duplicating all of their information. I am working around it by just removing the duplicate data when I export to excel.

    Thanks for your help!

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

Similar Threads

  1. Need help creating a query
    By MeginMurphy in forum Queries
    Replies: 3
    Last Post: 04-25-2014, 12:38 PM
  2. Creating a query
    By aubtiger14 in forum Queries
    Replies: 3
    Last Post: 12-09-2013, 07:39 PM
  3. Creating a query in VBA help?
    By offie in forum Programming
    Replies: 9
    Last Post: 07-15-2013, 01:54 PM
  4. Replies: 3
    Last Post: 01-01-2013, 06:22 PM
  5. need help with creating a certain query
    By tosho in forum Queries
    Replies: 4
    Last Post: 03-30-2012, 02:24 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