I have the below SQL code which I am wanting to take the number from the PPD.Month_Diff and add that number (of months) onto a column that is already in date format:
CONVERT(varchar, (DATEADD(MONTH,ED.books_close_date, PPD.Month_Diff)))
However when I run this code I get an error as below
Msg 8116, Level 16, State 1, Line 53 Argument data type datetime is invalid for argument 2 of dateadd function.
I'm not sure if its the conversion part or something else that I'm missing?
Use the correct order of the parameters:
DATEADD (Transact-SQL)