if i have 2 tables :
table1 (stocks)
Expand|Select|Wrap|Line Numbers
- stk_no stk_date stk_qty
- ------ -------- -------
- abcd 20081101 10
- abcd 20081115 20
- abcd 20081121 15
Expand|Select|Wrap|Line Numbers
- cal_date workingday
- -------- ----------
- ...
- 20081101 Y
- 20081102 Y
- 20081103 N
- 20081104 N
- ...
- 20081130 Y
- ...
Expand|Select|Wrap|Line Numbers
- stk_no stk_date stk_qty
- ------ -------- -------
- abcd 20081101 10
- abcd 20081102 10 <-- stk_qty of 20081101
- abcd 20081103 10 <-- stk_qty of 20081101
- ...
- abcd 20081114 10 <-- stk_qty of 20081101
- abcd 20081115 20
- abcd 20081116 20 <-- stk_qty of 20081115
- abcd 20081117 20 <-- stk_qty of 20081115
- ...
- abcd 20081120 20 <-- stk_qty of 20081115
- abcd 20081121 15
- abcd 20081121 15 <-- stk_qty of 20081121
- abcd 20081121 15 <-- stk_qty of 20081121
- ...
- abcd 20081130 15 <-- stk_qty of 20081121
thanks in advance.