web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

X++ using maxof and minof in the same sql statement

(0) ShareShare
ReportReport
Posted on by 352

Hi Everybody

How can we use at the same time minof and maxof in one sql statement ?

like doing select maxof(AccountingFate), minof(AccountingDate) from .... ?

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    You cant, result is saved into the field, so the easiest way is to do 2 select statements 

  • Suggested answer
    julianto1988 Profile Picture
    10 on at

    Hi,

    I have faced the same requirement and I achieved by creating a view with string computed column.

    public static server str MinAccountingDate()
    {
    tableName viewName = tableStr(View);


    return SysComputedColumn::min(SysComputedColumn::returnField(viewName, identifierStr(viewDatasourceTable) , fieldStr(viewDatasourceTable.AccountingDate)));

    }

    public static server str MaxAccountingDate()
    {
    tableName viewName = tableStr(View);


    return SysComputedColumn::max(SysComputedColumn::returnField(viewName, identifierStr(viewDatasourceTable) , fieldStr(viewDatasourceTable.AccountingDate)));

    }

  • Suggested answer
    JauB Profile Picture
    352 on at

    Yes that's why I did, but wished to do it proprly .. !

    Thanks

  • Suggested answer
    JauB Profile Picture
    352 on at

    Thanks Julian for your suggestion

  • Suggested answer
    julianto1988 Profile Picture
    10 on at

    You're welcome, just let me know if you need more help..

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans