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)

How to give alias to an aggregate field.

(0) ShareShare
ReportReport
Posted on by

Hi,

 

How can I add an alias to an aggregate field.

Following is my code sample:

while select BrandName, count(RecId) from brandsTable
join BrandRecId, ProductName from productsTable
group by brandsTable.BrandName
where brandsTable.RecId == productsTable.BrandRecId
{

.........
}

I want to give an alias to count(RecId):

Thanks,

Tauseef.

*This post is locked for comments

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

    Thanks a lot Crispin.

    That's what I have used in my while loop and it is giving me the desired result.

    But I was curious to know is there anything like alias in X++ select query.

    Thanks.

  • Verified answer
    Faisal Fareed Profile Picture
    10,796 User Group Leader on at

    Hi Tauseef,

    X++ does not have all the functions available of SQL queries so please don't expect you can do everything in AX which is possible in SQL.

  • Community Member Profile Picture
    on at

    Thanks Faisal and Crispin.

    Sorry for my stupid questions.

    Actually its been 8 years now I am working on .NET and SQL.

    And I am totally new to AX 2012.

    So, sometimes my mind automatically tends to compare the two.

    So don't mind.

    Thanks a lot.

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