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 :
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.
 
 
 
I have the same question (0)
  • 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,304 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

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,917

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,161 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,025 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans