Add a function to get the week number
1229
Views
2
Comments
On our RadarOn our Radar
Backend

There are date functions like Year(), Month(), Day(), DayOfWeek()... but no Week() to return the weeknumber. If you want to use the weeknumber in a aggregate you can't. To bad, because then you must use a advanced query and use (SQL Server):

datepart(week, <date>)

Funny thing is, when you look at the executed SQL of an aggregate where you use e.g. Year() as a formula of a custom column, Outsystems rewrites this to:

datepart(year, <date>)


Could be useful, but be aware: there are many standards with regards to what the week number for a given date is. I'm not sure whether all database engines implement it the same (probably not).

Hi Please check below Forge Component for the Purpose mentioned above.

https://www.outsystems.com/forge/component-overview/14559/week-number-of-month-and-year


Regards.