I’ve built a query for my coin collection database to calculate the precious medal melt value of gold and silver coins {see below}. What I want to do is to pull the current price of gold and silver from another table CODES which is not included in the query. The reason it is not in the query is that it contains a list of country codes for the coins and is linked to the Code field as shown in the Currency table in the image. There are fake codes in the Codes table for Gold “XAU” and Silver “XAG” however these two codes do not appear in the Currency table as the codes in that table are for identifying the country that issued the coin. Is there a way to build the formula for Current Value so that it can pull the values from the Codes table or as an alternative prompt for the values, I really don’t like editing the query every time I want to use it.
Here’s the SQL code attached to the query design below:
SELECT Currency.Comments, Currency.Year, Types.Description, Currency.Code, Currency.ASW, Currency.AGW, Round([AGW]*1392,2)+Round([ASW]*34.34,2) AS CurrentValue FROM [Currency] INNER JOIN Types ON Currency.Type = Types.Type WHERE (((Currency.Comments) Like “*gold*” And (Currency.Comments) Not Like “*Golden*”) AND ((Types.Description)=”Coin” Or (Types.Description)=”Set”));