how to display two different amount with same document no. from the same table?

How to get two different amount with same document no. from the same table? For e.g both document is 44 and supplier no. is 55. The amounts for the records are 15 and 0.1 . How do i display the two amounts?

Vat1.Reset;

Vat2.RESET;

Vat2.SETFILTER(Vat2.Bill, Vat1.Bill);

Vat2.SETRANGE(Vat2.“Document”, Vat1. "Document ");

IF Vat2.FINDSET THEN BEGIN

REPEAT

BaseAmtNoGst := Base;

MESSAGE(’%1’, BaseAmtNoGst);

UNTIL Vat2.NEXT = 0;

END;

This is my code. However, it does not work properly. Please advice

Where you want to show the amount ?

Is it on Form/Page/Report ?

I want to show the amounts on the report.

What is base data item for report ??

Vat Entry

You can take these value in variable and display it.

Will it be always for two documents ?

How about adding them together??

BaseAmtNoGst := BaseAmtNoGst + Base;

Nope.

Then :slight_smile: ?

Setfilter(DocumentNo,44|55);

both document no. is 44 and supplier no. is 55. The amounts for the records are 15 and 0.1 . how do i add them together?

Document no. supplier no. amount

11111 33 15

11111 33 0.1

means 15.1.

Repeat

BaseAmtNoGst := BaseAmtNoGst + Base);

until Table.next=0;

I tried the repeat method. But it add up all the amount values of the table. How do I filter out these two records and add them together?

Document no. supplier no. amount

11111 33 15

11111 33 0.1

you need write code which filters the document no.

Table.setrange(Table.documentno,variabletable.documentno);