Results 1 to 7 of 7
  1. #1
    trb5016 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Pennsylvania
    Posts
    71

    Should I have an "Or" in fieldname? (shudder)

    For part of my database we need to track how people are paid. (i.e. keep a history of what funds paid for what person's "salary"



    Design Stipulations:

    A person is either paid bi-weekly (wage) or monthly.

    A person can only be wage OR monthly at a time, but a wage person could become monthly at some point and vice versa.

    Each Month/Pay Period their could be 1 or more funds that go towards a persons "salary"

    My first idea is to create separate tables, one for wage and one for monthly and each of those tables has an additional table to keep track of the funds.



    This seems potentially wasteful because the "Monthly Funds" and "Wage Funds" Tables are really identical. Also, the "Monthly" and "Wage" tables are basically storing almost the same information.

    To combat this I came up with this idea.


    This has 2 fewer tables but would require storing the 2 week pay code OR a month in the same field. While this will be a finite dropdown (26 codes + 12 months) Having an OR in a field name is a big No-No.

    Anyone have any suggestions? Something I haven't tried?

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Try using your OR field in the second design and adding an additional field telling you if it is a wage or salary. you can either do "PayInd" and have the options be salary, wage, comission, stipend, etc. that way when you report, you can query off of PayInd and you'll know that your OR field will display the correct data.

    Will that work for you?

  3. #3
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    First, why not store the wage history of the employee. Anytime there is a change in rate or term (biweekly or monthly) then you would add a new record with a new effective date. The record with the most recent date is what you would use to calculate their current pay.

    tblEmployeeWageHistory
    -pkEmpWageHistoryID primary key, autonumber
    -fkEmpID foreign key to your employee table
    -payRate
    -fkPayTermID foreign key to tblPayTerm
    -dteEffective

    tblPayTerm (2 records: monthly and biweekly)
    -pkPayTermID primary key, autonumber
    -txtPayTerm

    I would have a table to hold the pay period info and specify which pay term each applies to

    tblPayPeriod
    -pkPayPeriodID primary key, autonumber
    -dtePayDate
    -fkPayTermID foreign key to tblPayTerm

    Then you would junction the payperiod and employee's most recent pay history in your wages table

    tblWages
    -pkWagesID primary key, autonumber
    -fkPayPeriodID foreign key to tblPayPeriod
    -fkEmpWageHistoryID foreign key to tblEmployeeWageHistory (you would actually use an aggregate query (Max(effectivedate) to pull the correct record)

    Of course you would then have a one to many relationship with the funds from which the wage is funded.

  4. #4
    trb5016 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Pennsylvania
    Posts
    71

    Going with this

    Shabz, Your idea would definitely work, my only thought is that it would be storing semi-redundant info in the new field because if its a Month it has to be non-wage. But it would definitely make writing queries easier.

    jzwp11, your solution is great for most payroll things, but this is a bit different. I wasn't clear enough in my OP

    Each month/pay period the funds the wage is being paid from changes (not 100% but most of the time)

    The end goal is each fund has a given amount and we'll eventually want to calculate the remaining balance.

    Your idea is so close to working, but: There isn't really a need for an effective date that a rate goes live because it is always changing for the pay period/month (due to the finances coming from a different fund)

    gah, this is so confusing, I might just go with with Shabz's idea and say to heck with whatever proper normalization might be.

  5. #5
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    i dont see how it is redundant. if wage and monthly is all you will ever offer just make that field a yes/no called "IsMonthly" or "IsWage". That still looks normalized to me.

  6. #6
    trb5016 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Pennsylvania
    Posts
    71
    Quote Originally Posted by TheShabz View Post
    i dont see how it is redundant. if wage and monthly is all you will ever offer just make that field a yes/no called "IsMonthly" or "IsWage". That still looks normalized to me.
    Yea, you're correct, I'm not sure what I was thinking. I've just been looking through my past designs and being super critical of everything I thought was right.

    Marking as solved...

  7. #7
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I failed to show how the funds worked into the structure I proposed previously. I've attached an example database that illustrates the complete design.

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

Similar Threads

  1. Replies: 3
    Last Post: 04-10-2010, 10:22 AM
  2. Replies: 21
    Last Post: 06-03-2009, 05:54 PM
  3. aSTR = Dir("C:\*.*") >> "Type Mismatch"
    By JGrant in forum Programming
    Replies: 1
    Last Post: 03-28-2009, 05:17 AM
  4. Replies: 2
    Last Post: 08-31-2006, 12:19 PM
  5. "Count" and "Countif" in Reports
    By JMantei in forum Reports
    Replies: 1
    Last Post: 06-20-2006, 02:20 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