This one is fairly short and I did a lot of testing to verify it works OK:
ISO Week of Year Function
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=60510
This has the week and day of week included:
ISO Year Week Day of Week Function
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=60515Returns the ISO 8601 Year Week Day of Week in format YYYY-W01-D for the date passed.
There are a number of columns with ISO week support in this date table function:
Date Table Function F_TABLE_DATE:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61519
ISO_YEAR_WEEK_NO - ISO 8601 year and week in format YYYYWW
Example = 200403
ISO_WEEK_NO - ISO 8601 week of year in format WW
Example = 52
ISO_DAY_OF_WEEK - ISO 8601 Day of week number, Mon=1, Tue=2, Wed=3, Thu=4, Fri=5, Sat=6, Sun=7
ISO_YEAR_WEEK_NAME - ISO 8601 year and week in format YYYY-WNN
Example = 2004-W52
ISO_YEAR_WEEK_DAY_OF_WEEK_NAME - ISO 8601 year, week, and day of week in format YYYY-WNN-D
Example = 2004-W52-2
Edit: Didn't see that this is an old thread and that I had already posted on it. :doze: