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 :
Microsoft Dynamics AX (Archived)

Select sum count

(0) ShareShare
ReportReport
Posted on by

Hello everyone!

I need to do smt like that...

Select count(RecID) sum(Field) from MyTable

I have to do this in one select but i dont know how. Any ideas?

Thanks!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi Juras,

    I think you need to make count and sum in the same select query .

    The below select query will give the both the Sales Line record count and the sum of sales quantity.

    Code :

    static void Test_Data(Args _args)

    {    

       SalesLine  salesLine;

       select count(RecId),sum(SalesQty) from salesLine;

       info(strFmt("Number of Records : %1  Total Quantity : %2",SalesLine.RecId,SalesLine.SalesQty));

    }

    Output :

    If the above thing is not suit for you means please explain how exactly you want or if you satisfied with this answer please verify it.

    Thanks,

    Malleswaran

  • Community Member Profile Picture
    on at

    Thanks for your answer. I was trying everything, but i forget about  comma sign! Thanks a lot ;)

  • Community Member Profile Picture
    on at

    Hi Juras,

    Could you please make my answer as verified answer(verify my answer ).

    Thanks in Advance,

    Malleswaran

  • karthickarden Profile Picture
    135 on at

    Hello Malleswaran,

    Could you help to find out  the list of custom tables and System tables in the AOT.

    Is there any query available to find out the list?

    Thanks,

    Karthick.M

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans