Re: OT weekdates in MSSQL [Re: just to laugh]
"Lyle H. Gray" <[email protected]> Sat, 29 Aug 2020 12:04:18 -0500
| Newsgroups | comp.databases.mysql |
|---|---|
| Message-ID | <[email protected]> |
Jim H <[email protected]> wrote in news:[email protected]: >>IIRC iso weeks start on Monday, ordinary weeks start on Sunday. >>Look at the linux 'date' command, specifically %V (%G) and %U >>That may suggest why 20210101 is isoweek 53. > > As I (think I) recall... you can get the ISO week by counting > Thursdays in the year to date. The first "full" week of the year under ISO standard 8601 is the first week with four days/first week with a Thursday in it (ISO weeks start on Monday, not Sunday, as noted above). In this group, though, we should be talking about the functions WEEK(), YEARWEEK(), and WEEKOFYEAR(), not DATEPART(), since MySQL doesn't have a DATEPART() function.