Hi all again,
I think the answer is this as mensioned
@David Callery, i added the LUpd_DateTime to obtain the PerClosed as the last movement, but I have a doubt in Status Field.
Can someone clarify this question for me please?
I will appreciate your help
Gracias
SELECT VendId,RefNbr,DocType,PerPost,PerClosed,LUpd_DateTime,CuryId,OrigDocAmt,DocBal,CuryDocBal
FROM APDoc where OpenDoc = 1and CuryId='MN'
and DocBal between '0.01'and '1'
BEGIN TRAN
UPDATE APDoc set
PerClosed =CONVERT(nvarchar(6), LUpd_DateTime, 112),
CuryDocBal = 0,
DocBal = 0,
OpenDoc = 0,
Status=?
where RefNbr='XXXXX'and VendId ='XXXX'
ROLLBACK TRAN
------------------------------
Manuel Vela
Tec
------------------------------
Original Message:
Sent: Feb 01, 2023 11:32 AM
From: Manuel Vela
Subject: Small Balance/Credit Wirte Off in Accounts Payable
Hello dear SL bloggers,
Do you have a procedure similar to Small Balance/Credit Wirte Off in Accounts Receivable but for Accounts Payable?
This is because I have more than a thousand documents (VO, AC, DC, PP) with a balance of 0.0# in DocBal or CuryDocBal since I handle 2 currencies,
I hope you can help me with some SQL procedure since I cannot apply them since it tells me that the balance is zero.
Thanks to all and best regards
------------------------------
Manuel Vela
Tec
------------------------------