Skip to the content.

Date functions like DATEADD, DATEPART expect a datepart token as the first argument; for example in

DATEPART(year, GETDATE())

the year is the datepart token. These values cannot be parameterized or take a value from a column - they are a special kind of literal value.

For the list of valid tokens, see here.