Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

Select Distinct Count of Records

(0) ShareShare
ReportReport
Posted on by

I have an entity called 'saleslineEnity' and I want to get the the number of salesid's without having to loop through all the records because there are so many. I tried this:

select count(RecId) from salesLinesEntity Group by SalesId

but it doesn't work

I guess I could make a direct call to the database:

  str sql = 'select count(distinct Salesid) from salesLineEntity';

*This post is locked for comments

  • Martin Dráb Profile Picture
    Martin Dráb 230,846 Most Valuable Professional on at
    RE: Select Distinct Count of Records

    This is a duplicate, The same post is already in your thread Count Records with Group by.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,971 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans