In R11:
SELECT AVG_RATE --gtr2.set_of_books_id, gtr2.period_name, gtr2.avg_rate
FROM APPS.gl_translation_rates GTR
WHERE set_of_books_id=998--ap_invoices.set_of_books_id
AND TO_CURRENCY_CODE = 'EUR' -- functional currency
AND upper(PERIOD_NAME) = 'JAN-96' --
IN R12:
In R12 gl_daily_rates is not specific to Set Of books or Ledger. So you won't set_of_books_id.
select CONVERSION_RATE from apps.GL_DAILY_RATES C
where TO_CURRENCY= 'EUR' -- functional currency
AND FROM_CURRENCY='USD' -- Parameter = AP_INVOICES.INVOICE_CURRENCY_CODE
AND CONVERSION_TYPE='Corporate' -- please check about which type your organization uses it
AND STATUS_CODE='C'
AND CONVERSION_DATE like sysdate
Hope this helps
Thank You,
Arun