Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hey folks! Was wondering if anyone would help me with calculating a database entry using item from current and last row entered?

I have a "change from prior year" column I would like populated by the difference between a decimal data type from the current entry and a decimal data type from the previous year.

So, if I had $20 this year and $15 last year, I would like the row with the $20 to also have a "change from prior year" that showed $5.

Can anyone help?

Thanks in advance!
Posted
Comments
RossMW 7-May-15 0:04am    
You will need to give the table structure as we cant guess or see it. If its the same table and depending on how the data is stored you could join the table to itself based on the different years.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900