
The ECB's history looks like a daily file until you join it to daily business data. It is one row per published day. Weekends and TARGET closing days are absent, and some currencies disappear for years. On the snapshot we tested, 7,141 USD rows covered 10,183 calendar dates. A plain date join left 3,042 payments without a rate.
The fix is not simply 'use the previous row'. Carry a Friday rate through a weekend, yes. Carry an Icelandic króna rate across a 3,335-day suspension, no. Store how old a carried rate is, and make the maximum age part of the query or the data build.
What is actually in eurofxref-hist.csv
The file is wide: Date,USD,JPY,..., one date per row, with N/A where that currency has no rate. A number means units of that currency for 1 EUR. The ECB says it normally publishes around 16:00 CET on working days except TARGET closing days, and says the reference rates are for information; using them as transaction prices is discouraged.
That 29.87% is not an estimate. Imagine one payment on every date in the range: 10,183 payments. JOIN rates ON rates.rate_date = payments.paid_on returns 7,141 and drops 3,042. A left join keeps the payments but leaves 3,042 rate values null.
First turn the wide file into a long table
Use a CSV unpivot step before the database, or let Rates Daily read the wide ECB file and download long CSV or SQL. Do not insert N/A; absence is useful information.
Option 1: build one row per calendar day
A daily table makes the application join boring, which is usually good. Keep the observed date and age beside the carried value. The example below uses a five-day ceiling.
On the tested snapshot, Rates Daily produced all 10,183 USD dates: 7,141 observed and 3,042 carried. The oldest normal carry is around long holiday weekends. Anything beyond the chosen ceiling stays a gap instead of looking current.
Option 2: an as-of join without materialising days
PostgreSQL
MySQL 8
SQLite
The index order matters: (currency, rate_date) lets each lookup seek to one currency and walk backward to the first eligible date. The daily table trades storage for simpler joins; the as-of form stores less but repeats the lookup. Pick on correctness and workload, then measure on your database.
The ISK hole is why the age limit belongs in the design
The ECB suspended Icelandic króna publication after capital controls and the loss of a reliable market-determined rate. It resumed ISK effective 2018-02-01. Filling that interval would not repair weekends; it would invent nine years of unchanged prices. With a five-day maximum, those dates remain null and visible.
The same rule covers currencies that ended because a country adopted the euro. CYP and MTL stop in 2007, EEK in 2010, LVL in 2013, LTL in 2014 and HRK after 2022. Their last value is not a forever exchange rate. Keep a currency-validity table or let the age ceiling stop the carry.
Derived pegs need the same date and age
The ECB file does not need to contain every currency you bill in. Bahrain officially keeps the dinar at 0.376 BHD per USD. Because the ECB quote is USD per EUR, derive BHD per EUR = USD per EUR × 0.376. If USD/EUR is 1.1520, the result is 1.1520 × 0.376 = 0.433152 BHD per EUR. Copy the USD observed date and age onto the derived row.
The checks to keep beside the load
Also record the source file's last date. A perfectly filled daily table can still be stale because the import stopped running. Alert when the newest observed date is older than the publication schedule you expect.
A practical default
For reports and payment normalisation, we would build the daily table once, carry at most five calendar days, retain observed_on and age_days, and reject anything older. For occasional analysis, use the as-of join with the same ceiling. In both cases, aggregate after the join and count null rates before trusting the total.
Related: several currencies in one SQL table covers minor units and rate direction; a calendar table in SQL builds the date spine used by the gap check.
Drop the ECB history into Rates Daily, choose currencies and a maximum age, then download a long CSV or SQL for PostgreSQL, MySQL 8 or SQLite. It runs in your browser.
Open Rates DailySources and snapshot
ECB, Euro foreign exchange reference rates and framework; ECB Governing Council, ISK publication resumed effective 1 February 2018; Central Bank of Bahrain, monetary policy and the 0.376 BHD/USD peg. File figures are from the ECB history snapshot ending 2026-11-20, tested by Rates Daily on 2026-11-23. The SQL illustrates join semantics; no performance timings are claimed.


