Hi All,
Before starting to mess up things, I would like to ask some advise, I have to store data in 2 different tables. Table one has the following structure;
ID|MATID|FULLWEIGHT|EMPTYWEIGHT|BUYPRICE
Table 2 has structure;
ID|MATID|WEIGHT|HOWMANY|BUYPRICE
The quer(y/ies) should should give the following result;
Table 1
(FULLWEIGHT - EMPTYWEIGHT) = NETTO * BUYPRICE = WEIGHTAMOUNT
Table 2
HOWMANY * BUYPRICE = HOWMANYAMOUNT
One query should create a receipt on both on amounts and calculate total
Second query should extract both weights to a stock report.
At this moment I already have Table 1 fully functional and was wondering how best to combine both, put additional fields in Table 1 or create Table 2 and try to combine them somewhere.
To further explain my lack of knowledge; 80% of transactions are based on Table 1 on Weight, 20% of transaction are items that are bought as items but their weight has to be stored so stock weight can be calculated, or an amount of a certain MATID can be extracted. If not clear, I can explain further..
Before starting to mess up things, I would like to ask some advise, I have to store data in 2 different tables. Table one has the following structure;
ID|MATID|FULLWEIGHT|EMPTYWEIGHT|BUYPRICE
Table 2 has structure;
ID|MATID|WEIGHT|HOWMANY|BUYPRICE
The quer(y/ies) should should give the following result;
Table 1
(FULLWEIGHT - EMPTYWEIGHT) = NETTO * BUYPRICE = WEIGHTAMOUNT
Table 2
HOWMANY * BUYPRICE = HOWMANYAMOUNT
One query should create a receipt on both on amounts and calculate total
Second query should extract both weights to a stock report.
At this moment I already have Table 1 fully functional and was wondering how best to combine both, put additional fields in Table 1 or create Table 2 and try to combine them somewhere.
To further explain my lack of knowledge; 80% of transactions are based on Table 1 on Weight, 20% of transaction are items that are bought as items but their weight has to be stored so stock weight can be calculated, or an amount of a certain MATID can be extracted. If not clear, I can explain further..