for example my input is 0323 and i need output march-2023 (or) 03-2023
Discussion posts and replies are publicly visible
Hello theramganeshvempati,
Try this code and change it according to your requirement. this might do the work. you can also wait for replies with some easy steps from experts.
a!localVariables( local!value:"0323", local!split:a!forEach( items: enumerate(len(local!value))+1, expression: local!value[fv!item] ), local!month:tointeger(concat(local!split[1],local!split[2])), local!year:tointeger(concat("20",local!split[3],local!split[4])), { text(date(local!year,local!month,1),"mmm-yyyy") } )
a!localVariables( local!input: "0323", local!month: tointeger(index(local!input, { 1, 2 }, {})), local!year: tointeger( concat("20", index(local!input, { 3, 4 }, {})) ), text( date(local!year, local!month, 1), "m-yyyy" ) )
You can change the value of "m" to "mmm" to print the 3 letters of the month's name
Hello ,
You can try this too, Hope it helps
local!date:"0323", local!newDate:concat(left(local!date,2),"-20",right(local!date,2)),
Hello anshikag0001,
'0323' is the resultant output. for the code you have given. May be you haven't copied the complete code here.
Pls check the output for local!newDate variable.
a!localVariables( local!date: "0323", local!newDate: concat( left(local!date, 2), "-20", right(local!date, 2) ), local!newDate ),
thanks for the answer