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

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans