/ Published in: SQL
The week function produces week numbers 1 to 52, starting from the first Sunday in the year (week runs Sunday to Saturday). Rather than rolling over the remaining few days in the year to week 01, the function produces week 53 which is not a full week. This code therefore ensures you always have 52 full weeks, albeit a few days may not be in the same year.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Week*: IIf(Format([DateField],"ww")=53,"Wk 1-" & Format([DateField],"yyyy")+1,"Wk " & Format([DateField],"ww-yyyy"))