Here are a few examples on how the error is generated: SELECT DATEADD(DD, 10) -– Missing Date Parameter Each parameter or argument doesn’t have a default value that it will use when a value is not specified. Given the definition of a DATEADD date function as well as the parameters it requires, calling the DATEADD function without specifying one of the required parameters will generate this error. If a string literal is passed to this parameter, it must resolve to a DATETIME data type. The parameter can be an expression, column expression, user-defined variable, or string literal. Lastly, the parameter is an expression that can be resolved to a TIME, DATE, SMALLDATETIME, DATETIME, DATETIME2, or DATETIMEOFFSET data type value. If a value with a decimal fraction is passed to this parameter, the fraction part is truncated and not rounded. User-defined variables are allowed to be passed to this parameter.
The second parameter, the, is an expression that can be resolved to an INT data type that is added to a of the parameter. The parameter is the part of the parameter to which an integer is added. The syntax of the DATEADD built-in date function is as follows:Īll three parameters of the DATEADD function are required. The return data type is the data type of the input date parameter, except for string literals where the return data type will become DATETIME.
The DATEADD date function returns a specified date with the specified number interval (signed integer) added to a specified datepart of the input date. The dateadd function requires 3 argument(s). SQL Server Error Messages - Msg 174 - The dateadd function requires 3 argument(s).Įrror Message Server: Msg 174, Level 15, State 1, Line 1 Home > SQL Server Error Messages > Msg 174 - The dateadd function requires 3 argument(s).