Subtract Years

This post is referring to Vahana 2 (beta version). To check the document for production, please go to vDesigner-v1.0

This function subtracts a specific number of years (for example, 2) from a date with the dd/mm/yy or dd/mm/yyyy formats. For instance, assume you want to subtract 2 years from the 05/03/24 (5 March, 2024) date. After you use the SUBYEARS() function to subtract 2 years from the 05/03/24 date, it performs the subtraction and then returns the 05/03/22 (5 March, 2022) date.

You can use the SUBYEARS function as follows:

To use the SUBYEARS function:

  1. Click in the smart selector to display the Search box.
  1. In the Search box, enter subyears to display the SUBYEARS function.
  1. In the list, select the SUBYEARS function to display it with the dateformat, and years parameters.
  1. In the SUBYEARS function, click Date to display the Search box.
  2. In the Search box, enter static to display the Static function.
  1. In the list, select the Static function to display it with the value and the String parameters.
  2. In the Static function, click the value parameter and then enter a date (for example, 05/03/24 or 05/03/2024) in dd/mm/yy or dd/mm/yyyy format.

Note:- If you do not want to enter the date manually by using the Static function, you can fetch the value of the date from an element or entity. To know more about defining the value in the entity, visit the post, Using Entity with Date and Time Functions.

  1. In the ADDYEARS function, click the format parameter and then enter dd/mm/yy in the place of the format parameter.
  1. In the SUBYEARS function, click the years parameter to display the Search box.
  2. In the Search box, enter static to display the Static function.
  1. In the list, select the Static function to display it with the value and the Integer parameters.
  2. In the Static function, click the value parameter and then enter a value (for example, 2) that you want to subtract from the earlier defined date (05/03/24).

Was this article helpful?
YesNo