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.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
OussamaSabbouh 1,850 Super User 2026 Season 1
YUN ZHU 1,045 Super User 2026 Season 1
Dhiren Nagar 959 Super User 2026 Season 1