Split string date

Can i split string ‘7/26/2011’ to ‘0711’ (MMYY) and ‘10/26/2011’ to ‘1011’ (MMYY)?

if i use subStr, it is not flexible. anybody’s help me?

HI ysfbryn

try this…

static void Example(Args _args)
{
TransDate d;
int i;
yr y;
str s,s1;
;
d = today();
i = mthOfyr(d);
y = year(d);
s = strfmt("%1%2",i,substr(int2str(y),3,4));

info(s);
}

Naresh Kolli

ExtractPostPeriodDates()

{

str strDate, strDate1;

str iYear, iMonth;

;

strDate = PostingPeriod.valueStr();

iYear = substr(strDate,1,4);

iMonth = substr(strDate,5,2);

strDate1= ‘01-’+iMonth+"-"+iYear;

_dtStartDate = str2date(strDate1,123);

_dtEndDate = endmth(_dtStartDate);

}

try this way it ll helpful for u