G
Guest
Have two tables, one called ExchangeRates with Country, Month and (Exchange) Rate fields, the other called ExchangeRatesLastMonth with just Country and Rate fields. The latter table needs to be updated so that it just contains one month's values from the former table (the month being the last month with non-null values). The question is how do you use the LastMonth parameter. My SQL below (when I type in the month) produces zeros for all rates. BTW I'd like to run this from a VBA routine.
UPDATE ExchangeRatesLastMonth RIGHT JOIN ExchangeRates ON ExchangeRatesLastMonth.Country = ExchangeRates.Country
SET ExchangeRatesLastMonth.Rate = [ExchangeRates].[Rate
WHERE ((([LastMonth])=[ExchangeRates].[Month]))
TIA, Rob
UPDATE ExchangeRatesLastMonth RIGHT JOIN ExchangeRates ON ExchangeRatesLastMonth.Country = ExchangeRates.Country
SET ExchangeRatesLastMonth.Rate = [ExchangeRates].[Rate
WHERE ((([LastMonth])=[ExchangeRates].[Month]))
TIA, Rob