BAQ : Most recent InvoiceDate

Another option that works if your fields aren’t ordered by date, is to use SQL Window Functions: