DBO.EQ_STD_EXCHANGE_RATE_GET(PARAMETER 1, PARAMETER 2, PARAMETER 3, PARAMETER 4)
This function will return the Company or System level exchange rate based on what has been configured on the specified company's Exchange Rate Settings screen. The function will accept a from currency, to currency, effective date and company Id.
Note that in order to use this DBO function correctly to retrieve System level exchange rates, a company Id must be specified as the last parameter.
Parameter
Parameter1: Base / From currency. The currency can be specified e.g. 'GBP' or any field in the system where the currency is stored e.g. [Assignment: From Currency], [Currency Exchange Rate Company: Base Currency], etc.
Parameter2: Output / To currency. Similar to Parameter 1, a currency can be specified as a static value like 'USD' or any field in the system where the currency is stored e.g. [Assignment: To Currency], [Currency Exchange Rate Company: To Currency], etc.
Parameter3: Date when exchange rate is effective. This can be a fixed date (e.g. '01-02-2017') or a dynamic date (e.g. February YYYY's rates by using CAST(YEAR(GETDATE()) AS VARCHAR(4))+'-02-01' )
Parameter4: [Company: Id] this is required whether a company or system level exchange rate is required.
Example(s)
Example 1: Retrieving system exchange rates using current system date as the effective exchange rate date.
DBO.EQ_STD_EXCHANGE_RATE_GET([Currency Exchange Rate Company: Base Currency], [Currency Exchange Rate Company: To Currency], GETDATE(),1)
For the system exchange rates to be retrieved, the Rate Source field on the specified company's Exchange Rate Settings page must be set to System. In this example, ABC Company has the company Id = 1. The lookup logic selected on the Exchange Rate Settings page determines how the function looks up the rate for the specified date used in the DBO function at the system level. The rate can be looked up using an Exact Date Match, Exact Month Match or a where the specified date falls within a date range using the Days Prior and Days After fields.
In this example, the DBO function uses the System exchange rate because System is specified as the Rate Source and retrieves system exchange rates with effective dates that falls between 180 days prior to the current system date and 0 days after.
Example 2: Retrieving a Company exchange rate using current system date as the effective exchange rate date.
DBO.EQ_STD_EXCHANGE_RATE_GET([Currency Exchange Rate Company: Base Currency], [Currency Exchange Rate Company: To Currency] , GETDATE(),4)
For the company exchange rates to be retrieved, the Rate Source field on the specified company's Exchange Rate Settings page must be set to Company. In this example, Learning Plc has the company Id = 4. The lookup logic set on the Exchange Rate Settings page determines how the function looks up the rate for the specified date used in the DBO function at the company level. The rate can be looked up using an Exact Date Match, Exact Month Match or a where the specified date falls within a date range using the Days Prior and Days After fields.
In this example, Learning Plc company's exchange rates are used by the DBO function because Company is specified as the Rate Source. The DBO function retrieves company exchange rates with effective dates where there is an exact match with the current system date's month and year.
Things to Note
If the Exchange Rate Settings are not configured for the company the DBO function will use the below default logic:
It will use the System exchange rates. The Exchange logic logic will an exact date match lookup (i.e. effective date must exactly match the effective date of the system exchange rate for a value to be returned) and default the days prior and days after values to 0


