![]() * create table of the sample dates you provided, adding another date to help verify date logic */ See if these calcs give you results more like what you want.Įdit: Note that the calcs are completely independent of any/all date and language and DATEFIRST setting and will work correctly under ANY of them. That will be different for calendar year vs fiscal year vs retail, etc. To count the number of weeks for a year - you need to define what the first of the year is for your calendar. For US the first of the year is 01/01 always and you get a short week 1 (except when Sunday is the 1st of the year) and a short 52/53 week at the end of the year. The week number is based on how you determine the start of the year - for ISO the start of the year is the Monday prior to the first Thursday of the year. The end of 2021 is 2022-01- only has 52 weeks where 2020 has 53 weeks. ISO week sets the week number in the previous/following years also - which means for year 2020 week 53 ends on and week starts on. If the OP wants something else, say Sunday to Saturday, then some sort of offset is required. I was trying to make the point that an iso_week runs Monday to Sunday. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |