Skip to Content
0

conversion of month to integer in BODS

May 12, 2017 at 01:11 PM

40

avatar image

Hi,

I am trying to convert Month value to its corresponding integer value in the output table.

Can you please tell me the functions for the same ?

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

1 Answer

Todd Floyd May 17, 2017 at 01:27 PM
0
var date_string = "5/17/2017"
var split = date_string.split("/");
var day_int = Convert.stringToInt(split [ 1 ]);
var month_int = Convert.stringToInt(split [ 0 ]);
var month_string = "" + month_int; 
var day_string = "" + day_int;
if (month_int < 10) {
month_string = "0" + month_int;
}
if (day_int < 10) {
day_string = "0" + day_int;
}
Share
10 |10000 characters needed characters left characters exceeded