Hi all, how can i get the latest invoice per customer in soshipheader??
thanks
*This post is locked for comments
Hi all, how can i get the latest invoice per customer in soshipheader??
thanks
*This post is locked for comments
If you want the most recent invoice number for each customer the following should work:
select custid,max(invcnbr) from soshipheader group by custid
If you want the most recent invoice date it can be a bit tricky because you could have more than one invoice on the same date so the following could return more than one invoice per customer
select custid,max(invcdate) from soshipheader group by custid
André Arnaud de Cal...
293,280
Super User 2025 Season 1
Martin Dráb
232,038
Most Valuable Professional
nmaenpaa
101,156
Moderator