There is a exchanges table, which need to keep updated exchange rates everyday. If today exchange rates do not change, then just copy yesterday rates and insert to the table.
There are over 20 rates for a single day.
I wrote the following SP.
1) How to select yesterday data? getDate()-1 ?
2) How to insert all yesterday data to today data?
ALTER PROCEDURE [dbo].[SP_Update_Exchanges]
Declare @currency int
Declare @referencerate decimal(18,6)
Declare @buy decimal(18,6)
Declare @sell decimal(18,6)
SET NOCOUNT ON;
SELECT @currency=currency, @referencerate=referencerate, @buy=buy, @sell=sell from exchanges where systemdate = getDate()-1
insert into exchanges (currency,referencerate,buy,sell,systemdate)