View previous topic :: View next topic
|
Author |
Message |
Deeps1234
New User
Joined: 26 Jun 2009 Posts: 2 Location: US
|
|
|
|
Hi,
I have three tables:
Code: |
Table1:
Tran id Tran date Tran amt Sch code
01 01/20/2009 150K S1
02 01/20/2009 203K S2
Table2:
Sch code effective date Sub sch code
S1 01/01/2009 SS1
S2 01/01/2009 SS2
Table3:
Sub sch code Amt upper limit pts
SS1 99999 10
SS1 999999 20
SS1 9999999 30
Basically this table should be:
Table3:
Sub sch code Amt lower limit Amt upper limit pts
SS1 0 99999 10
SS1 100K 999999 20
SS1 200K 9999999 30
but it stores only the upper limit.
|
Now the requirement is that for each transaction we have to find the pts from table3 based on the sch code and tran amt. To get the pts tran Tran amt should fall between the lower limit and upper limit amt defined in Table3.
Can you please help with this? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Your example data does not appear to be consistent.
Suggest you re-post the sample table data with a bit more variety in the data. You will also want to provide the processing "Rules" of how the data should be operated on.
When posting the inputs you have and the output you want, use the "Coide" rag (as you have done) but also use the Preview to make sure the post appears to the forum as you want it. |
|
Back to top |
|
|
|