How can I determine if an invoice is still open or not?

I’m trying, from an SQL query, to get the open invoices. The goal is to get pretty much the same data from the Aged Receivables Report. I was wondering if there is a field somewhere that tells if the ar invoice is open or not?

Thanks

InvcHead.OpenInvoice

It doesn’t seem to show the same data as the Aged Receivables Report if I just select the data WHERE InvcHead.OpenInvoice=1

Have you checked if InvcHead.Posted = 1?

Aged Receivables will show invoices already closed if the report date is before payments were made.

I used the Posted=1 and OpenInvoice=1 and I see the 5 invoices from the Aged Receivables Report. I’ll try to do other tests but it seems to work

I usually say InvcHead.InvoiceBal <> 0