Problem with record displaying

Hi,

Currently I’m developing a report.

Let’s say 1 payment voucher settled 2 Invoices.

Payment Voucher, PV001, settled INV01 and INV02

Based on my query in processReport method():

vendTrans vendTrans, vendTrans1;

while(queryRun.next())

{

_vendTrans = queryRun.get(tablenum(VendTrans));

_temporaryTableName.voucher = _vendTrans.Voucher;

select _vendTrans1

where _vendTrans1.LastSettleVoucher = _temporaryTableName.voucher;

_-temporaryTableName.Invoice = _vendTrans1.Invoice;

}

This query only able to show out the output as below:

Voucher Invoice

PV001 INV01

However when I tried the following query:

while(queryRun.next())

{

_vendTrans = queryRun.get(tablenum(VendTrans));

_temporaryTableName.voucher = _vendTrans.Voucher;

select _vendTrans1

where _vendTrans1.LastSettleVoucher = _temporaryTableName.voucher;

_-temporaryTableName.Invoice = _vendTrans1.Invoice;

}

The output shown:

Voucher Invoice

PV001 INV02

I would like to know is there any way that I able to show the records as below:

Voucher Invoice

PV001 INV01

PV002 INV02

Thanks and Appreciated.

Sorry for providing wrong info:

Currently I’m developing a report.

Let’s say 1 payment voucher settled 2 Invoices.
Payment Voucher, PV001, settled INV01 and INV02

Based on my query in processReport method():
vendTrans vendTrans, vendTrans1;
while(queryRun.next())
{
_vendTrans = queryRun.get(tablenum(VendTrans));
_temporaryTableName.voucher = _vendTrans.Voucher;

select _vendTrans1
where _vendTrans1.LastSettleVoucher = _temporaryTableName.voucher;
_-temporaryTableName.Invoice = _vendTrans1.Invoice;
}
This query only able to show out the output as below:

Voucher Invoice
PV001 INV01

However when I tried the following query:
while(queryRun.next())
{
_vendTrans = queryRun.get(tablenum(VendTrans));
_temporaryTableName.voucher = _vendTrans.Voucher;

while select _vendTrans1
where _vendTrans1.LastSettleVoucher = _temporaryTableName.voucher
{
_-temporaryTableName.Invoice = _vendTrans1.Invoice;
}
}

The output shown:
Voucher Invoice
PV001 INV02

I would like to know is there any way that I able to show the records as below:
Voucher Invoice
PV001 INV01
PV002 INV02

Thanks and Appreciated.

Not sure about your query.

To know against which vendor transactions the payment has been settled, you need to look at the vendSettlement table.

For how to join these tables, look at the relation with vendTrans (in VendSettlement table).

For reference, the same question is already discussed on another forum.