Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a problem with two tables:
Day | Worker |
---|---|
01/01/2013 | A |
02/01/2013 | A |
03/01/2013 | A |
04/01/2013 | A |
Day | Production |
---|---|
01/01/2013 | 10 |
02/01/2013 | 20 |
04/01/2013 | 40 |
When the two tables are conected the first table lose one row, 03/01/2013, because of there is not production. The problem is that I need this row and not to lose.
In Access it is solved because it is possible to change the relation and show all data of a table (include all register of one table and only the ones in common of the other).
I need to count all rows of the first table.
Thanks in advance
Best regards,
If you are using the Join command in the script, try Left Join instead. It will keep everything from the first table and only Join Day from the second table that exist in the first.
Table1:
Load
Day as %Day,
1 as DayCounter, //used to count Day
Worker
From Table 1;
Left Join (Table1)
Table2:
Load
Day as %Day,
Production
From Table 2;
Day | Worker | Production |
---|---|---|
01/01/2013 | A | 10 |
02/01/2013 | A | 20 |
03/01/2013 | A | - |
04/01/2013 | A | 40 |
HI,
As Micheal specified in the above post use Left Join so that you don't miss any rows in the first table.
Table1:
Load
*
From Table 1;
Left Join (Table1)
Table2:
Load
*
From Table 2;
Hope this helps you.
Regards,
Jagan.
Try with mapping load to fill out null values as well.
MAP_PROD:
Mapping LOAD DATE, PRODUCTION FROM TABLE ;
WORKER_INFO:
LOAD DATE,
WORKER,
ApplyMap('MAP_PROD', DATE , 'ND');
FROM TABLE;
So if the Production is not exist for date, ND will be inserted by ApplyMap.