|
|
Enter the purchase price of your home then
select the region in which your property is
located.
Select the quarter and year when the property was purchased.
Select quarter and year for the period over which you want to see
your home valued
Press "Get Price" to see results below. |
<%
if request.form("button")<>"" then
dim valuation_price, growth, purchase_price, rows, x, avg_x, start_y, end_y, start_q, end_q, bought_price, change_price
start_y=request.form("year_start")
end_y=request.form("year_end")
start_q=request.form("quarter_start")
end_q=request.form("quarter_end")
bought_price = Request.Form("Price")
if bought_price = "" then
bought_price = 0
end if
if (start_y+start_q)<=(end_y+end_q) then
strSQL = "SELECT * FROM HousePricesNSA " _
& "WHERE region='"& Replace(Request.Form("region"), "'", "''") & "' " _
& "AND years>='" & Replace(Request.Form("year_start"), "'", "''") & "' " _
& "AND years<='"& Replace(Request.Form("year_end"), "'", "''") & "';"
Set cnnLogin = Server.CreateObject("ADODB.Connection")
cnnLogin.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
& "DBQ=" & Server.MapPath("App_Data/2_7t_93e6_0x/HouseP3.mdb"))
Set rstLogin = cnnLogin.Execute(strSQL)
Dim aTable1Values
aTable1Values = rstLogin.GetRows()
If Not rstLogin.EOF Then
' Clean Up 1
rstLogin.Close
Set rstLogin = Nothing
cnnLogin.Close
Set cnnLogin = Nothing
end if
strSQL = "SELECT * FROM HousePricesNSA " _
& "WHERE region='U K' " _
& "AND years>='" & Replace(Request.Form("year_start"), "'", "''") & "' " _
& "AND years<='"& Replace(Request.Form("year_end"), "'", "''") & "';"
Set cnnLogin = Server.CreateObject("ADODB.Connection")
cnnLogin.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
& "DBQ=" & Server.MapPath("App_Data/2_7t_93e6_0x/HouseP3.mdb"))
Set rstLogin = cnnLogin.Execute(strSQL)
Dim aTable1Values2
aTable1Values2 = rstLogin.GetRows()
If Not rstLogin.EOF Then
' Clean Up 2
rstLogin.Close
Set rstLogin = Nothing
cnnLogin.Close
Set cnnLogin = Nothing
end if
Dim iRowLoop, start_price, end_price
rows = UBound(aTable1Values, 2)
purchase_price = aTable1Values(UBound(aTable1Values, 1), 0+start_q-1) 'we move this on by quarters
valuation_price = aTable1Values(UBound(aTable1Values, 1), UBound(aTable1Values, 2)-4+end_q) 'we reduce this by quarters
growth_factor = valuation_price/purchase_price
growth = growth_factor-1
value = FormatCurrency(bought_price*growth_factor,0)
change_price = bought_price/purchase_price
dim price()
dim avg_price()
redim price(rows)
redim avg_price(UBound(aTable1Values, 2))
For iRowLoop = 0 to UBound(aTable1Values, 2)
price(iRowLoop)= round(aTable1Values(6, iRowLoop)*change_price)
avg_price(iRowLoop)= aTable1Values2(6, iRowLoop)
Next 'iRowLoop
x=join(price,"|")
avg_x=join(avg_price,"|")
'response.write(x)%>
<%
'response.write(avg_x)%>
<%
'response.write(purchase_price*change_price)%>
<%
'response.write(valuation_price*change_price)%>
<%
'response.write(rows)
%>
|
|
|
|
| |
| At the end of the period selected your property is estimated
to be worth *<%response.write(value)%>. The rate of change is <%response.write(FormatPercent(growth))%>
|
| |
| *Price will vary for areas and style of property within regions
and for the style of property. For an accurate valuation of your property seek professional advice from
a surveyor. Data is provided by a third party over whom we have no control.
No warranties provided. |
| |
<%
else
%>
| <%
response.write("Purchase Period cannot be after Valuation Period, please amend your selections")
%> |
<%
end if 'period test
end if 'button
%>