| Author |
Topic  |
|
|
chulz90
Starting Member
Indonesia
22 Posts |
Posted - 11/29/2012 : 05:38:24
|
i'm having trouble now, can you help me to fix it please???
Item Table Item Qty BR_001 100
MR table MR_Number --Date-- --Item-- --Status MR-- MR_001 --26/11/12-- --BR_001-- --Approved-- MR_002 --27/11/12-- --BR_001-- --Approved-- MR_003 --28/11/12-- --BR_001-- --Approved-- MR_004 --29/11/12-- --BR_001-- --Approved--
MR_line table MR_Number --Item-- Qty Request MR_001 --BR_001-- 50 MR_002 --BR_001-- 30 MR_003 --BR_001-- 40 MR_004 --BR_001-- 70
DO table DO_Number --MR_Number --Date --To Location --Status DO DO_001 --MR_001 --26/11/12 --Area 1 --Approved DO_002 --MR_002 --27/11/12 --Area 2 --Approved DO_003 --MR_003 --28/11/12 --Area 3 --Approved
DO_line table (This the answer) DO_Number --Item --Qty Needed DO_001 --BR_001 --5 DO_002 --BR_001 --3 DO_003 --BR_001 --4
The case is, when i generate new DO_Number below: DO_Number --MR_Number --Date --To Location -- Status DO_004 -- MR_004 --29/11/12 --Area 4 --Approved
when DO_004 booked item BR_001 is there any query to show DO_Line table above "BASED ON" DO_004 because DO_004 have MR_004 which is it cointain item BR_001.
please help me???
|
Edited by - chulz90 on 11/29/2012 05:46:09
|
|
|
nigelrivett
Flowing Fount of Yak Knowledge
United Kingdom
3328 Posts |
Posted - 11/29/2012 : 05:41:20
|
>>is there any query to show DO_Line table above "BASED ON" DO_004
Is that the question? What result would you expect?
========================================== Cursors are useful if you don't know sql. SSIS can be used in a similar way. Beer is not cold and it isn't fizzy. |
 |
|
|
chulz90
Starting Member
Indonesia
22 Posts |
Posted - 11/29/2012 : 05:48:52
|
quote: Originally posted by nigelrivett
>>is there any query to show DO_Line table above "BASED ON" DO_004
Is that the question? What result would you expect?
========================================== Cursors are useful if you don't know sql. SSIS can be used in a similar way. Beer is not cold and it isn't fizzy.
the result is to show DO_Line table but i want to show it from DO_004
u have an idea???? |
 |
|
|
bandi
Flowing Fount of Yak Knowledge
India
1689 Posts |
Posted - 11/29/2012 : 06:19:07
|
As per my understading, you have 5 tables (Item, MR, MR_line, DO, DO_line tables)
when you insert a row into DO table, then u need the previous values related to that DO_number.... right?
If there is only 4 tables(Item, MR, MR_line, DO table), what is the logic for Qty in ur result?
quote:
DO_line table (This the answer) DO_Number --Item --Qty Needed DO_001 --BR_001 --5 DO_002 --BR_001 --3 DO_003 --BR_001 --4
-- Chandu |
 |
|
|
nigelrivett
Flowing Fount of Yak Knowledge
United Kingdom
3328 Posts |
Posted - 11/29/2012 : 07:07:39
|
select d.DO_Number , m.Item, [Qty Needed] = m.[Qty Request] from DO d join MR_line m on d.MR_Number = m.MR_Number
Are you missing a 0 off the qty needed or is it qty requested / 10 or something else?
========================================== Cursors are useful if you don't know sql. SSIS can be used in a similar way. Beer is not cold and it isn't fizzy. |
 |
|
| |
Topic  |
|