I apologize- I am still very new to SQL and getting a handle on the basics.
I have a two tables
Exchange rates:
Currency | Q1 Echange Rate | Q2 Echange Rate |
---|---|---|
USD | 1 | 1 |
AUD | .56 | .57 |
EUR | 1.12 | 1.124 |
Invoices:(in Local Cuurency)
Currency| Jan Invoice| Feb Invoice| March Invoice| April Invoice|
AUD | 5,000 | 8,000 | 10,000 | 20,000
EUR | 10,000 | 4,0000 | 7,000 | 12,000
I would like to be able to make a column Jan USD, Feb USD, March USD, April USD (and so on) by taking the exchange rate associated with the currency and quarter and multiplying it by the invoice number.
In excel I could do a simple (Vlookup on the table Invoices, column currency, look in exchange rate to find the match.)(Jan Invoice) and have it fill in a column called “Jan USD”
how would I do this in SQL?
Thank you!
I am honestly so new at SQL that ive messed around a bunch but couldnt figure out how to do both at once
Mya_H is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.