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...
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 371
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
 
I have the same question (0)
  • Gerardo Rentería García Profile Picture
    25,371 Most Valuable Professional on at
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,443 Super User 2025 Season 2 on at
    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
  • Verified answer
    Manuel Lozada Profile Picture
    371 on at
    Thanks Mohamed I solved the problem according your code and Renteria link.
  • Mohamed Amine Mahmoudi Profile Picture
    26,443 Super User 2025 Season 2 on at
    Hi @Manuel,
     
    Please verify the answers that helped.
     
    Mohamed Amine MAHMOUDI

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,066

#2
YUN ZHU Profile Picture

YUN ZHU 658 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 595

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans