1435
Views
7
Comments
Solved
How to convert month(interger type) to string(name of month)?
Question

Hi all!

As I mention above, I don't know how to convert month (Interger data type) to string data type(Name of Month) in aggregate or expression.

Example: 1->January, 

                3->March.

Warm Regards,

Huy,


2020-02-28 09-46-54
Eduardo Jauch
Solution

Hi Huy, 

I don't think there is a function for that. 

You could create a new date with your month and use the date to text conversion with the mmm format (it will give the month name). 

Or you can just write a function that receives an integer and return the name of month as output using a switch or a sequence of IFs. 

Cheers

2019-11-12 19-06-13
Ramesh Thalli

Eduardo Jauch wrote:

Hi Huy, 

I don't think there is a function for that. 

You could create a new date with your month and use the date to text conversion with the mmm format (it will give the month name). 

Or you can just write a function that receives an integer and return the name of month as output using a switch or a sequence of IFs. 

Cheers

 Here is an Example:

Month is your integer variable:
FormatDateTime(NewDateTime(2020,Month,1,0,0,0),"MMM")

 

2019-04-17 22-09-44
Omar Alejandro Soto Anaya

Hi Huy,

these are some fuctions to conver data, maybe this can help you https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Data_Conversion

regards.




UserImage.jpg
Huy Nguyen

Omar Alejandro Soto Anaya wrote:

Hi Huy,

these are some fuctions to conver data, maybe this can help you https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Data_Conversion

regards.




Hi Omar Alejandro Soto Anaya,

I have already checked that list data conversion but couldn't find suitable function. Could you please be more specific about how to conver int (1->12) to name of month ?



2020-02-28 09-46-54
Eduardo Jauch
Solution

Hi Huy, 

I don't think there is a function for that. 

You could create a new date with your month and use the date to text conversion with the mmm format (it will give the month name). 

Or you can just write a function that receives an integer and return the name of month as output using a switch or a sequence of IFs. 

Cheers

2019-11-12 19-06-13
Ramesh Thalli

Eduardo Jauch wrote:

Hi Huy, 

I don't think there is a function for that. 

You could create a new date with your month and use the date to text conversion with the mmm format (it will give the month name). 

Or you can just write a function that receives an integer and return the name of month as output using a switch or a sequence of IFs. 

Cheers

 Here is an Example:

Month is your integer variable:
FormatDateTime(NewDateTime(2020,Month,1,0,0,0),"MMM")

 

2019-04-17 22-09-44
Omar Alejandro Soto Anaya

Hi Huy,

try this solution posted in an older post https://www.outsystems.com/forums/discussion/37034/name-of-the-month/

regards.

2014-10-21 20-15-17
Alberto Ferreira

Well In fact to get the full month name and not the abreviated

FormatDateTime(NewDateTime(2020,Month,1,0,0,0),"MMMM") 


Regards

UserImage.jpg
Abduerhman Salama

FormatDateTime(TextToDate("2000-"+MonthNumber + "-10"),"MMM")

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.