Skip to main content

Notifications

Microsoft Dynamics SL (Archived)

latest invoive per customer

Posted on by Microsoft Employee

Hi all, how can i get the latest invoice per customer in soshipheader??

thanks

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: latest invoive per customer

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans