help with access query

E_Gold

Registered User.
Local time
Today, 21:16
Joined
Sep 18, 2010
Messages
26
hi

i have this table Discount:

from | to | Dis
1 | 50 | 10
51 | 80 | 20
81 | 99 | 30
99 |120 | 40
and i have this work table MyTable:

id | sum | dis
123| 22 |
222| 85 |
131| 85 |
how to fill the dis field in MyTable ? that the table will look like this:

(if the sum between the from and the to value)

id | sum | dis
123| 22 | 10
222| 85 | 30
131| 95 | 40
i need it in access

thanks in advance
 
As a calculated field in your query you could use a DLookup()

Dis:DLookup("[dis]","Table","From" >= Summation)

code for brevity only.
 
There's no relationship between Discount and MyTable so this really can't be achieved.
 

Users who are viewing this thread

Back
Top Bottom