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...
Answered

How to calculate in a formula the number of the days since start the year with the current day

(0) ShareShare
ReportReport
Posted on by 357
Hi Community,
 
Do you know how to calculate in a formula the number of the days since start of the year with the current day?
 
In this case, I want to replace the number 116 that is the number of the days since start the year, with a field or variable that calculate this number automatically.
 
 
If you know how I would appreciate it.
 
Thanks
 
  • Mohamed Amine Mahmoudi Profile Picture
    17,146 Super User 2025 Season 1 on at
    How to calculate in a formula the number of the days since start the year with the current day
    Hi @Manuel,
     
    Please verify the answers that helped.
     
    Mohamed Amine MAHMOUDI
  • Verified answer
    Manuel Lozada Profile Picture
    357 on at
    How to calculate in a formula the number of the days since start the year with the current day
    Thanks Mohamed I solved the problem according your code and Renteria link.
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    17,146 Super User 2025 Season 1 on at
    How to calculate in a formula the number of the days since start the year with the current day
    Hi @Manuel,
     
    to calculate the number of days you need to use this code:
    var
        dt: date;
        year: Integer;
        days : Integer;
    begin
        year := Date2DMY(Today(), 3);
        dt := DMY2Date(1,1,year);
        days:= Today() - dt;
    end;
    Best regards,
    Mohamed Amine MAHMOUDI
  • gdrenteria Profile Picture
    15,464 Most Valuable Professional on at
    How to calculate in a formula the number of the days since start the year with the current day

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,907 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,777 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans