MONTH Function in TM1: Syntax and Use
The Month function in TM1 extracts a numeric version of month from a text string that represents a date, where the date has been presented in either YYYY-MM-DD or YY-MM-DD format. It is similar to the “extract” SQL function when combined with the “month” operator.
For example, if you have a date of ‘2017-11-28′, this function will return the number 11 (not the string ’11’).
Syntax of the MONTH Function
The syntax is:
Month ( date ); where:
- date is the string or text version of a date in either YYYY-MM-DD or YY-MM-DD format.
An example of its use is where we have a date index that we know, let’s say the index associated with the date 9-Mar-1998, which is 13947. We then have a variable called sDate and into it we store the string date associated with that index by using the DATE function.
sDate = Date (13947 , 1); Month ( sDate);
This will return the number 3 (for March), which can then be used in numeric calculations.
This function can be used in Rules and Turbo Integrator processes.