Hmmm that is my function similiar to above but IMHO easier to understand
CREATE FUNCTION ISOweek(@date datetime)
RETURNS int
AS
BEGIN
declare @dayOfWeek int
declare @1ThISOWeek1ThDay datetime
declare @4ThJan datetime
declare @1ThJan datetime
declare @31ThDec...