The SQL Script below will create a function that resides on the Dynamics database. Just open up SQL Server Management Studio and run the script below. The function will convert any non USD currency into US Dollars. This can be useful for companies using many different currencies.

The function takes into account the Exchange Expiration Dates and whether or not the exchange is multiply or divide. These configuration settings for Mufti-Currency are all within the system settings of Dynamics GP.

The function requires you to pass through the amount, document date or GL Post Date and Currency ID. Below is an example of the script being used against the PurchaseLineItems view which is a canned view on the Dynamics GP company databases.