Sabtu, 08 Februari 2014

[MS_AccessPros] Lookup Table Query

 

Would any of you please help me with this query?  I have been able to created via a Switch Function, but I wonder if there is a more elegant way to solve this problem:


I have a position matrix table that has 3 columns: Quality (ranging from 1 to 4), Upside (> =10%,>=20%, and >=30%) and the third column named PositionSize that has a series of sized corresponding with the Quality and Upside.

So, If I have list of stocks (about 100 tickers) that have Quality Rating and Upside (for example, IBM has a Quality Rating of 3 and upside of 15%).

How can I write a query to look up the Position Size for the list of these 100 stocks? For the IBM example, since it has a quality of 3 and upside of 15%, the return value should be 1.5.

I have no knowledge of SQL, so would you please show me how to write the code in Access query?

Thanks so much!

Tim


Quality Upside PositionSize
1 >= 10%                -  
1 >= 20%           0.25
1 >= 30%           0.50
2 >= 10%           0.75
2 >= 20%           1.00
2 >= 30%           1.25
3 >= 10%           1.50
3 >= 20%           1.75
3 >= 30%           2.00
4 >= 10%           2.25
4 >= 20%           2.50
4 >= 30%           3.00

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
.

__,_._,___

Tidak ada komentar:

Posting Komentar