This topic is locked

Get Records Previous Data

5/2/2011 12:50:11 AM
PHPRunner General questions
A
angelcause author

I am creating a database for salary generation and my fields are as below
EmployeeID

Name

PreviousBalance

CurrentSalary

Total

Balance
Now i know that when i add the first record of "JOHN" it is fine, but when again i will add a record of "JOHN" I want to automatically get the previous balance as well. Please HELP me through.

Sergey Kornilov admin 5/2/2011

You need to clarify what "want to automatically get the previous balance" means and what do you want to do with this balance.

A
angelcause author 5/3/2011



You need to clarify what "want to automatically get the previous balance" means and what do you want to do with this balance.



Thanks for the response.

Sorry I was missing the Amount Paid and Month field:
For example I have entered a record of John as below

EmployeeID 001

Name John

Month April

PreviousBalance 0

CurrentSalary 10000

Amount Paid 5000

Total 10000

Balance 5000
Now when I enter the next record which will be of the next month of John it should be like this
EmployeeID 001

Name John

Month May

PreviousBalance 5000 ( It should automatically get the value of balance from the previous record of John (April))

CurrentSalary 10000

Amount Paid 12000

Total 15000

Balance 3000