Skip to Content

Is it possible to use Input Parameter in ADDMONTHS ( ) function in a calculated column?

Feb 02 at 07:04 AM


avatar image

Hi Experts,

Addmonths ( ) function is perfectly worked for columns.



But It wont work when I use Input Parameters inside that function.



when I use the above expression it throws an error like as invalid Expression.

Input Parameter Datatype is Date.

And,I also tried with the integer Datatype., It won't works.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Florian Pfeffer
Feb 02 at 01:53 PM

For the column engine no such function exists. In the SQL engine the function is called ADD_MONTHS (not ADDMONTHS). Using it in an SQL engine calculated column, when putting the parameter name in single quotes works quite will (if a syntax validation error occurs, just ignore it).



Show 9 Share
10 |10000 characters needed characters left characters exceeded

Hi Florian Pfeffer ,

Thanks for your reply....

Then the above code is works perfectly in a column engine itself against a column...

I.e., addmonths ( ) function....

The problem is with input parameters....

Addmonths ( ) function is working. Lars Breddemann give this solution for one of the problem which is posted in


If you could create a direct link to the blog you mean, it would be helpful.


It is possible... I tried this function and it works... I got my desired output...


Ok, just tested it. Although the function is not documented, it somehow works in the column engine too. But as mentioned above, you have to enclose the parameter name with single quotes + ignore the syntax validation errors.

addmonths('$$IP_DATE$$', 2)

Thanks Florian Pfeffer ,

I already tested that too....

When we create a input parameter with integer, we no need to give single quotes....

Other than integer data type i.e., date or nvarchar, when we drag input parameter to the expression, single quotes enclosed automatically...


I cannot really follow that what you wanna say. Have you tried it now with quotes for the date parameter or not. If not than do it.

Thanks Florian Pfeffer ,

If I validate the Below expression It throws an error like Invalid Expression... I just ignoire it and activate the view.


Its activated Successfully and got my desired output..

It works Perfectly...


Hi Florian Pfeffer ,

If I changed column engine to SQL engine as you mentioned... How the performance will get affect...?