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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to find unique record in a table in business central

(0) ShareShare
ReportReport
Posted on by 153
Hi Guys,
In my below table, if i have multiple same record then I want to find unique value of date. or otherwise get count of unique record.
How to get/find that unique date through AL code. 
Output: 7/7/2023
               7/8/2023
 
 
 
Is any way to do this.
 
 
 
  • Suggested answer
    SeGra Profile Picture
    44 on at
    Hi,
    please refer to this blog Post https://yzhums.com/34036/
     
     
  • Nilam Bhor Profile Picture
    153 on at
    Hi SeGra ,
    I already follow this blog. In this blog it will show the text data type count.
    & I want to find unique date.
    Is any other way to do this.
  • Suggested answer
    Govinda Kumar Profile Picture
    2,310 Moderator on at
    To do this, you can start by filtering the records based on your date.. once you have filtered the records, you can compare them to another set of records and find the ones that do not match..
                if YourTableBuffer.FindSet() then
                repeat begin
                    YourTableBufferTwo.SetFilter(Date,'<>%1', YourTableBuffer.Date);
                    if (YourTableBufferTwo.FindSet())
                    then begin
                        ListOfUnMatchedRecords.Add(YourTableBufferTwo.ID);
                        count := count+1
                    end;
                    until YourTableBufferTwo.Next() = 0;
                end;
                until YourTableBuffer.Next() = 0;
    This is the example code for you.. 
    Regards

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

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 624 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 440 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 244 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans