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

Report date filter

(0) ShareShare
ReportReport
Posted on by 700

report 50101 EmployeeBirthdayReport
{
    Caption = 'Birthday';
    UsageCategory = ReportsAndAnalysis;
    ApplicationArea = All;
    DefaultLayout = RDLC;
    RDLCLayout = 'EmployeeBirthdayReport.rdl';

    dataset
    {
        dataitem(EntitlementSetup; EntitlementSetup)
        {
            DataItemTableView = sorting(No);
            column(FORMAT_TODAY_0_4_; Format(Today, 0, 4)) { }
            column(COMPANYNAME; COMPANYPROPERTY.DisplayName) { }
            column(EmployeeFilter; EmployeeFilter) { }

            // trigger OnAfterGetRecord()
            // var
            //     myInt: Integer;
            // begin
            //     EmployeeFilter := Employee.GetFilters;
            //     DateFilter := Employee.GetFilter("Birth Date");
            // end;

            dataitem("Employee"; Employee)
            {
                RequestFilterHeading = ' ';
                RequestFilterFields = "Office Location", "Status";


                // column(FORMAT_TODAY_0_4_; Format(Today, 0, 4))
                // {
                // }
                // column(COMPANYNAME; COMPANYPROPERTY.DisplayName)
                // {
                // }

                // column(CurrReport_PAGENO; CurrReport.PageNo)
                // {
                // }
                column(No_; "No.")
                {

                }

                column(First_Name; "First Name")
                {

                }
                column(Last_Name; "Last Name")
                {

                }
                column(Birth_Date; format("Birth Date"))
                {

                }
                // column(EmployeeFilter; EmployeeFilter)
                // {

                // }
                column(DateFilter; DateFilter) { }

                trigger OnPreDataItem()
                var
                    myInt: Integer;
                begin
                    If (FromDate > 0D) and (ToDate > 0D) then
                        SetRange("Birth Date", FromDate, ToDate);
                    EmployeeFilter := Employee.GetFilters;
                    // FromDateFilter := Employee.GetFilters;

                end;

                // trigger OnAfterGetRecord();

                // begin

                //     SetRange("Birth Date", FromDate, ToDate);

                // end;
            }

        }
    }
    requestpage

    {


        layout

        {

            area(Content)

            {

                field("From Date"; FromDate)

                {
                    ApplicationArea = All;
                    
                    

                }

                field("To Date"; ToDate)
                {
                    ApplicationArea = ALL;
                }

            }

        }

        trigger Onopenpage()              //sets default value for the Status filter as 'Active'
        var
            myInt: Integer;
        begin
            Employee.SetRange(Status, Employee.Status::Active);
            //Employee.SetRange("Birth Date", FromDate, ToDate);
        end;


    }


    var

        CurrReport_PAGENOCaptionLbl: Label 'Page';
        FromDate: Date;
        ToDate: Date;
        EmployeeFilter: Text;
        DateFilter: Text;

}

Hi All, 

In the above report, there are two date filters named From Date and To Date. I need that these filters should filter data according to date and month, by ignoring the year part.

Is it possible to achieve ?

If yes, how this could be done ?

Please suggest asap !

Thanks !

  • Dynamics 365 Business Central Profile Picture
    700 on at

    Please respond, it's urgent.

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,306 Super User 2026 Season 1 on at

    You can't filter date by ignoring the year part because it is part of the field.

    Do a date2dmy to get the day and month on each record during looping, and do CurrReport.Skip if it is outside the criteria.

  • Dynamics 365 Business Central Profile Picture
    700 on at

    Yes, I did Date2DMY, but not getting how to loop.

    I have provided the source code, would you please be able to make changes in it, if possible!

    It would be a great help.

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 August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 750 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 534 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 287 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans