PDA

View Full Version : ASP|Access - updating DB values based on value



burns
March 11th, 2006, 11:14 AM
Hi,

I am trying to update specific DB values based on another value.

I have a table that has property information, including:

ID - 1
Price - this is in either €, $, CYP or MAD i.e (€95,925.00)
Origprice - this is the price in £ of the above based on the days exchange rate i.e (£65,820)

The problem is the above is entered manually when a property is uploaded but I need to update the Origprice field based on a currency rate value that is changed manually throughout the day.

So if I upload a property that is €95,925.00 which is converted to £65,820 at the exchange rate of 1 EUR = 0.689872 GBP I have a table that contains the euro rate which can be manually updated if the rate changes.

What i need to do is update the origprice(£65,820) field value based on the on the price(€95,925.00) divided by the current rate.

How would I get the relevent fields from the DB?

price = select * from tblProperty(origPrice)

if that brings back the values, i guess it would be :

newprice = RS(origPrice)
origPrice= (newprice) / (rate)

I guess the query would be

update = update tblProperty set origPrice = "& origprice &"

Is this the right idea?

thanks