Skip to main content
1 of 3
mootinator
  • 1.2k
  • 1
  • 11
  • 17

T-SQL 166 Characters

SELECT PROCEDURE f29 (@d DATE) AS DECLARE @i int SET @i=YEAR(DATEADD(M,-2,@d)) SET @i=@i+(4-@i%4) IF @i % 100 = 0 AND @i % 400 0 SET @i=@i+4 SELECT DATENAME(W, @i) I was already messing with T-SQL date functions, so I figured why not...
mootinator
  • 1.2k
  • 1
  • 11
  • 17