Results 1 to 6 of 6
  1. #1
    JeredG is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    3

    How to structure my db?

    I'm trying to put a solution together for our scheduling administrator and need some direction. The administrator currently keeps a list of all absesnces (approved and unapproved) in an excel file that shows the employee's name, date of absence, total hours of absence and type of absence (tardy, out sick, FMLA, etc).



    What she needs is a single number showing the number of unapproved occurances the the past 365 days (rolling year). I've got the rolling year all set but I'm not sure if I need one query just for tardies and another just for out sick, etc and bring them together under a third query. Or is this something that I can build in reporter?

    I've been looking into the count functions but some occurances are weighed more heavily than others which leads me to the idea of separate queries that are brought together under a single survey.

    Thanks for all your help....

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,600
    Sounds like a report with Grouping & Sorting and aggregate calcs would produce the desired output. Are you linking to the spreadsheet?
    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. #3
    JeredG is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    3
    Quote Originally Posted by June7 View Post
    Are you linking to the spreadsheet?
    I was intending to create a form to have all future absences be entered directly into the table. For the 'proof of concept' version I imported the database directly into access to work on it. I'm assuming that would be the preferred method instead of linking, correct?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,600
    Yes, seems it would be best to have data in Access. You are not attempting to emulate a pay period time sheet form and data entry? This can be challenging in Access. If you want to provide some sample data will analyse.
    Last edited by June7; 11-14-2011 at 01:19 PM.
    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. #5
    JeredG is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    3
    No pay period stuff, just need to roll up tardies and absences into for a rolling 365 day period into a single number. Here's where the math gets really complicated:

    • Any tardies for any single agent in excess of 10 (11th or higher) equals a single occurance
    • Any tardy in excess of 7 min = 1 occurance
    • Three tardies less than 7 min = 1 occuance
    • plus normal sick time counted

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,600
    I built a simple table to test:
    Absences
    EmpID...AbsenceCat...DateAbsent...HoursAbsent
    1..........Tardy...........3/1/2011...... .1
    1..........Tardy...........3/3/2011...... .2
    2..........Tardy...........3/1/2011...... .2
    2..........Sick.............3/4/2011...... 8
    3..........Tardy...........3/2/2011...... .12

    Query to filter and summarize data by employee. Use this query to do additional analysis of data:
    SELECT Absences.EmpID, Sum(IIf([AbsenceCat]="Tardy" And [HoursAbsent]>=0.12,1,0)) AS GreaterEqual7, Sum(IIf([AbsenceCat]="Tardy" And [HoursAbsent]<0.12,1,0)) AS Less7, Sum(IIf([AbsenceCat]="Sick",[HoursAbsent],0)) AS SickTime, Sum(IIf([AbsenceCat]="Tardy",1,0)) AS TotalTardy
    FROM Absences
    WHERE (((Absences.DateAbsent) Between Now()-365 And Now()))
    GROUP BY Absences.EmpID;

    If you need more help, provide your data for analysis.
    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. Table Structure
    By riley73 in forum Database Design
    Replies: 5
    Last Post: 05-03-2011, 07:13 AM
  2. Hierachy Structure
    By anandram in forum Database Design
    Replies: 11
    Last Post: 05-02-2011, 12:20 PM
  3. New Guy Structure questions
    By cgjames in forum Database Design
    Replies: 11
    Last Post: 01-19-2011, 07:16 AM
  4. Help with Database Structure
    By scottay in forum Access
    Replies: 8
    Last Post: 06-30-2010, 08:16 AM
  5. SQL statment structure
    By oss_ma in forum Programming
    Replies: 1
    Last Post: 05-13-2007, 02:08 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