how to convert datetime to week number in sql code example Example: sql server week number datepart(wk, DateToParse)