G
Guest
Hi,
I'm using Access 2k, linked to SQL Server 2k. I have a prob with an update
query and I hope someone can explain it to me.
TESTMSTRACC = stores invoices
RECEIPTDETAILS = stores payment transactions
I have an update query that updates the Outstanding Invoice amount in
TESTMSTRACC with the payment from RECEIPTDETAILS as follows:
ALTER PROCEDURE dbo.sp_RECEIPTDETAILS_UPDATE
AS UPDATE dbo.TESTMSTRACC
SET dbo.TESTMSTRACC.OUTSTANDING = TESTMSTRACC.OUTSTANDING -
TEST_RECEIPTDETAILS.CURRPMNT
FROM dbo.TESTMSTRACC, dbo.TEST_RECEIPTDETAILS
WHERE TESTMSTRACC.MST_TRANS_IDX = TEST_RECEIPTDETAILS.MST_TRANS_IDX
(I have no idea about the first line as Access inserted it when I created
the query and won't seem to run without it!)
This update query works fine as it updates the values that I want it to,
however, I seem to having a problem with multiple transactions, ie.
RECEIPTDETAILS might contain two separately entered transactions (entered on
two separate days) that pay off the one invoice with two separate payments:
Invoice101 = $200
Receipt1 = $100
Receipt2 = $100
Apparently when I run the update query, it updates the invoice with the
first Receipt transaction, but it seems to ignore the second transaction?
Therefore when I do a reconciliation, I'm shown that Invoice101 still has
$100 outstanding, when it fact it has already been paid.
I would have assumed that the update query would calculate the first
transaction, $200-$100, then calculate the second transaction $100-$100 to
equal 0. Is this not the case?
Thanks for any explanations!
Winsa
I'm using Access 2k, linked to SQL Server 2k. I have a prob with an update
query and I hope someone can explain it to me.
TESTMSTRACC = stores invoices
RECEIPTDETAILS = stores payment transactions
I have an update query that updates the Outstanding Invoice amount in
TESTMSTRACC with the payment from RECEIPTDETAILS as follows:
ALTER PROCEDURE dbo.sp_RECEIPTDETAILS_UPDATE
AS UPDATE dbo.TESTMSTRACC
SET dbo.TESTMSTRACC.OUTSTANDING = TESTMSTRACC.OUTSTANDING -
TEST_RECEIPTDETAILS.CURRPMNT
FROM dbo.TESTMSTRACC, dbo.TEST_RECEIPTDETAILS
WHERE TESTMSTRACC.MST_TRANS_IDX = TEST_RECEIPTDETAILS.MST_TRANS_IDX
(I have no idea about the first line as Access inserted it when I created
the query and won't seem to run without it!)
This update query works fine as it updates the values that I want it to,
however, I seem to having a problem with multiple transactions, ie.
RECEIPTDETAILS might contain two separately entered transactions (entered on
two separate days) that pay off the one invoice with two separate payments:
Invoice101 = $200
Receipt1 = $100
Receipt2 = $100
Apparently when I run the update query, it updates the invoice with the
first Receipt transaction, but it seems to ignore the second transaction?
Therefore when I do a reconciliation, I'm shown that Invoice101 still has
$100 outstanding, when it fact it has already been paid.
I would have assumed that the update query would calculate the first
transaction, $200-$100, then calculate the second transaction $100-$100 to
equal 0. Is this not the case?
Thanks for any explanations!
Winsa