Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

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

editSubscribe (1) ShareShare
ReportReport
Posted on by
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
    Mohamed Amine Mahmoudi User Group Leader 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
  • 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
    Mohamed Amine Mahmoudi User Group Leader 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
    gdrenteria Super User on at
    How to calculate in a formula the number of the days since start the year with the current day

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Featured topics

Product updates

Dynamics 365 release plans