M
marnelle
below is my example tables:
issuance_table: transaction_table:
item condition qty. item condition
qty.
item1 good 1 item1 good
1
item2 good 1 item2 good
1
item1 damage 1 item1 damage 1
my query below will summed up the quantity from transaction_table and
issuance_table which is group by item and condition. It's execute fine for me
SELECT transaction_table.item, transaction_table.condition, Sum(
[transaction_table].[qty]+[issuance_table].[]qty)
AS Total_issued
FROM transaction_table
INNER JOIN issuance_table
ON (transaction_table.condition = issuance_table.condition)
AND (transaction_table.item = issuance_table.item)
GROUP BY transaction_table.item, transaction_table.condition;
query_output:
item condition Total_issued.
item1 good 2
item2 good 2
item1 damage 2
------but when there's an item initially set from issuance_table which is not
yet in transaction table, it will not appear when i run the query above.
example i have this table
issuance_table: transaction_table:
item condition qty. item condition
qty.
item1 good 1 item1 good
1
item2 good 1 item2 good
1
item1 damage 1 item1 damage 1
item3 good 1
when i ran the query, it looks like this
query_output:
item condition Total_issued.
item1 good 2
item2 good 2
item1 damage 2
as I notice, the item3 did not appear to the output query
Please help me with this problem, any suggestion will be appreciated
i want to output the query like shown below. Can you pls give me some hint or
query code
t oget rid on this. If there's no transaction yet, i want to display the
initial quantity.
query_output:
item condition Total_issued.
item1 good 2
item2 good 2
item1 damage 2
item3 good 1
thanks a lot, im looking forward for your answer
more power
issuance_table: transaction_table:
item condition qty. item condition
qty.
item1 good 1 item1 good
1
item2 good 1 item2 good
1
item1 damage 1 item1 damage 1
my query below will summed up the quantity from transaction_table and
issuance_table which is group by item and condition. It's execute fine for me
SELECT transaction_table.item, transaction_table.condition, Sum(
[transaction_table].[qty]+[issuance_table].[]qty)
AS Total_issued
FROM transaction_table
INNER JOIN issuance_table
ON (transaction_table.condition = issuance_table.condition)
AND (transaction_table.item = issuance_table.item)
GROUP BY transaction_table.item, transaction_table.condition;
query_output:
item condition Total_issued.
item1 good 2
item2 good 2
item1 damage 2
------but when there's an item initially set from issuance_table which is not
yet in transaction table, it will not appear when i run the query above.
example i have this table
issuance_table: transaction_table:
item condition qty. item condition
qty.
item1 good 1 item1 good
1
item2 good 1 item2 good
1
item1 damage 1 item1 damage 1
item3 good 1
when i ran the query, it looks like this
query_output:
item condition Total_issued.
item1 good 2
item2 good 2
item1 damage 2
as I notice, the item3 did not appear to the output query
Please help me with this problem, any suggestion will be appreciated
i want to output the query like shown below. Can you pls give me some hint or
query code
t oget rid on this. If there's no transaction yet, i want to display the
initial quantity.
query_output:
item condition Total_issued.
item1 good 2
item2 good 2
item1 damage 2
item3 good 1
thanks a lot, im looking forward for your answer
more power