diff options
Diffstat (limited to 'sql')
| -rw-r--r-- | sql/dawn.sql | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index e6a5a4fb..5f2df87a 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -298,7 +298,7 @@ $$ LANGUAGE plpgsql; CREATE OR REPLACE function fx_rate(p_date date) RETURNS TABLE(currency currency, fxrate float) AS $$ BEGIN RETURN QUERY SELECT unnest(Array['USD', 'EUR', 'CAD'])::currency, - unnest(Array[1, eurusd, cadusd]) FROM fx WHERE date=p_date; + unnest(Array[1, eurusd, cadusd]) FROM fx WHERE date<=p_date ORDER by date LIMIT 3; END; $$ LANGUAGE plpgsql; |
