Copying records

E9-Tech

Member
Local time
Today, 17:05
Joined
Apr 28, 2021
Messages
36
I am looking to develop further my DB project, I am currently tracking payslip data where I have 2 columns with amounts related to payments to a pension scheme, I would like to track transactions of the pension scheme in details and therefore I have additional transaction (e.g. purchase and selling of shares and administrative costs).

I want to record this information on tblPension and therefore every time I make an entry in tblPayslip I add a record also on tblPension by copying the date and the value of the two pension columns from payslip.

I have been reading and got some information and I believe that duplication of records is not ideal, the rationelle behing my thoughts of copying the data to a different table is because at some point I am only going to be tracking pension transactions and I could separate the table and have a new DB only for the pension tracking, therefore all the information will be contained in one table.

How can I copy the values to the new table in either after update or saving the record? Or any other solutions?

Thanks
 
instead of adding the two columns from payslip, just add the PK of that record and use the query to (joining pension and payslip via the number), so you can retrieve the 2 columns.
 
How can I copy the values to the new table in either after update or saving the record? Or any other solutions?

In response to the "any other solutions" category, may I respectfully suggest that you study the topic of "JOIN queries"? In a JOIN, there is NO need to move or copy data. A virtual copy of your data elements is right there where you need it.
 

Users who are viewing this thread

Back
Top Bottom