For the first part of this, let us look at the select statement for a single employee for a single check date. Below is the initial code.

Select UPR00100.EMPLOYID,

     UPR30300.UPRTRXAM,

     UPR30300.PYRLRTYP,

     UPR30300.PAYROLCD,

     UPR30300.TXBLWAGS

from UPR00100

inner join UPR30300 on UPR00100.employid = UPR30300.EMPLOYID

where UPR00100.employid = 'ACKE0001'

and UPR30300.CHEKDATE between '02/01/2014' and '02/01/2014'

 

Now, before you mention anything, yes, I have left out all the good UPR00100 stuff like the employees' first name, last name, etc. Let us concentrate on just getting these two tables connected; you can add the other fields later.

While this appears to work and for my TWO database it does return six records, to know what an employee actually make you cannot just add UPR30300.UPRTRXAM together and get the right number.

You must understand a little bit more about the UPR30300 table and what it contains.

For instance, notice the UPR30300.PYRLRTYP field. This field is incredibility important.

If the value of this field is equal to "1" then that is PAY to the employee. Notice I typed PAY, if you have an employee reimbursement, on a check, even though we all know that an employee reimbursement is not taxable, it is still PAY on the check itself. In other words, the amount is a positive amount of money due to the employee.

If the value of this field is equal to "2" then that is a deduction, in other words the amount is a negative amount of money due to the employee.

If the value of this field is equal to "3" then that is a benefit, in other words it is an amount of money paid on behalf of the employee, by the employer, to someone else like an insurance company. Thus, it does not affect the amount of the check at all.

If the value of this field is equal to "4" then that is the State Taxable amount. Yes, the UPRTRXAM field is the amount of State TAX withheld. Also notice, that when this field is equal to "4" the TXBLWAGS field has an amount in it. This amount is the amount of taxable wages for the state represented in the PAYROLCD field.

Now I did not get into local or city taxes, however, I am sure you can look at you own physical check and this table and figure out the codes, if not feel free to drop me a line. In addition, I did not get into things like FICA, Federal Tax, Tips, and such but I will save that for another time.

Till later,

 

Table of Contents