Add a function to get the week number

By Menno Hoogsteen on 2 Nov 2017

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>)


Kilian Hekhuis2 Nov 2017

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).