VendLedEntries.SETCURRENTKEY("Vendor No.","Posting Date","Currency Code"); VendLedEntries.SETRANGE("Vendor No.","Vendor Code"); VendLedEntries.SETRANGE("Posting Date",0D, EndingDate); VendLedEntries.SETRANGE("Currency Code","Currency Code"); IF VendLedEntries.FINDSET THEN BEGIN REPEAT VendLedEntries.CALCSUMS(Amount); TotalBalAmount:=VendLedEntries.Amount; UNTIL VendLedEntries.NEXT =0 ; LineNo+=1000 "Cal Balance Vendor".INIT "Cal Balance Vendor"."Amount":=TotalBalAmount; "Cal Balance Vendor"."Ending Date":=EndingDate; "Cal Balance Vendor"."Currency Code":=VendLedEntries."Currency Code"; "Cal Balance Vendor"."Line No":= LineNo; "Cal Balance Vendor".INSERT END;
Comments
Why you don't use Query to get amounts group by vendor and currency?
"Cal Balance Vendor".INIT
"Cal Balance Vendor"."Amount":=TotalBalAmount;
"Cal Balance Vendor"."Ending Date":=EndingDate;
"Cal Balance Vendor"."Currency Code":=VendLedEntries."Currency Code";
"Cal Balance Vendor"."Line No":= LineNo;
"Cal Balance Vendor".INSERT
I know the Query, but when the Currency Code group is on the Query I won't be able to call the Ending Date on report. When can you give me samples
Thanks
Thank you for replying. On this table, I use 2 Key (Vendor Code, Currency Code)
"Cal Balance Vendor"."Vendor Code" := ???
I believe you can use the CALCSUMS without the REPEAT loop (example below)