Notifications
Announcements
No record found.
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.
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).
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
OussamaSabbouh 3,064
Jainam M. Kothari 1,568 Super User 2025 Season 2
YUN ZHU 1,063 Super User 2025 Season 2