Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2006

    Unanswered: How to Calculate Year To Date Values

    I am still on the Payroll Program I have been developing. I want the Program to compute Year to Date (YTD) values for Basic Salary, Allowances, Deductions, Net Pay and Tax.

    I have tried and tried but have not been able to write the codes.

    Kindly help me.

    Thank you.


  2. #2
    Join Date
    Jun 2004
    Arizona, USA
    Without knowing anything about how your database is designed, it's a crap-shoot to come up with code to fill your requirements, but, ASSUMING that you have a table containing previous payroll data per wmployee per pay period, you would do something along the lines of
    SELECT SUM(Basic_Salary), Sum(Allowances), Sum(Deductions), Sum(Net_Pay) and Sum(Tax) From Payroll Where PayRollDate >= '01-JAN-07'
    (ps - don't use spaces in object names...)
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts