All three statements below return the same result. So I’m struggling to see what the difference is between using dayofyear, day and weekday. Am I missing something or are they all equivalent?
SELECT DATEADD(dayofyear,1,'20111231')
SELECT DATEADD(day,1,'20111231')
SELECT DATEADD(weekday,1,'20111231')
They all return 2012-01-01 00:00:00.000
In that use, no they return the same. Though “day” feels natural for this use.
The difference comes in (e.g.) DATEPART:
Here’s the MSDN ref on it: