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 get the week of the year?

(0) ShareShare
ReportReport
Posted on by 450

In AL programming is there a way to get or calculate the week of the year? So since there there are 52 weeks i would like to get the week of the delivery date. So the 10th of February 2020 would be week 7 of the year (if i'm not mistaken).

Thanks in advance.

I have the same question (0)
  • Verified answer
    gert@lynge.org Profile Picture
    on at

    Sure- the date2dwy function

    docs.microsoft.com/.../date2dwy-function--date-

    Be warned:

    Around the world there is different opinions on which day is the first day of the week and which week is week one.

    It might depend on the locale settings in the client (I'm actually not sure about how date2dwy handles that, so I'm just guessing here :-) ).

    See en.wikipedia.org/.../Week for further information about that.

    In Denmark Monday is the first day of the week and week 1 is the first week with a Thursday in it (meaning most of it's days are in the new year).

  • Verified answer
    Olister Rumao Profile Picture
    3,967 on at

    Simply use

    WeekNo := DATE2DWY(TODAY,2);

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 3,064

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,063 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans