Skip to Content

conversion of month to integer in BODS

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 ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 17, 2017 at 01:27 PM
    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;
    }
    Add comment
    10|10000 characters needed characters exceeded