sql server get week number based on all years code example Example: sql server week number datepart(wk, DateToParse)