|
MGarriga
Starting Member
5 Posts |
Posted - 2010-10-21 : 11:25:02
|
| I have the following table:PropertyID , YearSale , SalePrice , ImprYr, ImprValue1 , , , 1979 , 205001 , , , 1981 , 486001 , , , 1982 , 370001 , 2001 , 0 , ,1 , 2002 , 860000 , ,1 , , , 2003, 773701 , , , 2004, 90901 , 2006 , 1480000 , ,And I want to create a query that would add a new column, let’s call it PropertyValue,that would add to the SalePrice the Value of the improvements done after the sale, but the next sale will reset the property value back to saleprice, and it would ignore any improvements done before a sale, so that it will look like this:PropertyID,YearSale,SalePrice,ImprYr, ImprValue , propertyValue1 , , , 1979 , 20500 , 01 , , , 1981 , 48600 , 0 1 , , , 1982 , 37000 , 01 , 2001 , 0 , , , 01 , 2002 , 860000 , , , 860000 1 , , , 2003 , 77370 , 9377001 , , , 2004 , 9090 , 9464601 , 2006 , 1480000, , , 1480000I am completely lost on how to do this. Any ideas?Thank you |
|