AddMonths() Function
YouTube: How to Use the AddMonths () Function in Report Custom Columns?
How to Use the AddMonths () Function in Report Custom Columns?
In this Tutorial, we’ll learn how to design expression columns using the AddMonths
function in the reporting grid to calculate future dates based on existing bill dates.
Accessing the Expression Designer:
Navigate to the Reporting section.
Open the Sales Register Detailed Report or any "Report".
Go to Setup Column Attributes.
Here, you'll see a list of available columns that can be used to build expressions.
Click on "Add/Edit Expression Columns" where you can write your expression using predefined functions.

Before adding the expression to the report, go to Other Settings.
Ensure the Script Editor is set to VBScript.

Click Save.
Note: VBScript is the default for new configurations but always verify this setting.
Writing Your First Expression
Every expression must start with the script header: '#@LSCRIPT

Click the (+) Plus icon to create a new expression.
Fill in the required fields:
Expression Name – A unique name for your expression.
Expression Type – Choose either Text or Numeric depending on the expected output.

Creating a Simple AddMonths() Expression
Double-click the new expression name to insert it into the script editor.
Define the expression using the syntax:
Expression Name = ADDMONTHS(CDATE(BILL_DATE),3)
Begin the expression with the
AddMonths
keyword to create a new date by adding n number of months.CDate(Bill_Date)
converts the string to a valid date.3
is the number of months to add.

Save the expression once defined.
Scroll down and check the box beside the expression name to enable it.

Save and proceed to check the effect.
Refresh the report to view the final result.

Output:
Original Bill Date
Expression Output (+3 months
)
01-Apr-2025
01-Jul-2025
15-May-2025
15-Aug-2025
Last updated