Look up a range from within a query

mcgrcoAgain

Registered User.
Local time
Today, 21:53
Joined
Jan 26, 2006
Messages
47
Below is a table that I want to look up from a query. Basically I want to look up a value (e.g 3.56) and find which PRA it fits in so in this case 3.56 is between 3 and 6 so the value returned is 0.7. Where it gets complacted is that the 3.56 is generated on the fly in the query. Can I use a dlookup with a range. Ive tried but the syntax is wrong i think. DateDiff_RepToMat is the generated field (3.56)

Any help or suggestion are appreciated

x = DLookup("PRA", "tab_ref_MaturityRiskRatings", [DateDiff_RepToMat] BETWEEN [RangeLow] and [RangeHigh])


RangeLow RangeHigh PRA
0 1 0.00
3 6 0.4
6 12 0.7
 
DLookup("PRA","tab_ref_MaturityRiskRatings",[DateDiff_RepToMat] & " BETWEEN [RangeLow] and [RangeHigh]")

.
 
perfect, Many thanks .
 

Users who are viewing this thread

Back
Top Bottom