Assuming that the field you are working with is genuinely a date, this should work:
Code:
WhilePrintingRecords;
Local StringVar a := ToText({Table.Field}, 'MM dd yyyy');
Local NumberVar b := Len(a);
Local NumberVar i;
Local StringVar RESULT := '';
for i := 1 to b Step 1 do
RESULT := RESULT + Mid(a, i,1) + ' ';
Replace(RESULT, ' ', ' ')
If the field you are working with is not a date field, the approach will need to change. Please let us know how you go.
with error "bad number format string". then this was highlited.
whilePrintingRecords;
Local StringVar a := [highlight #FCE94F]ToText({ARRFH.DOCDATE},'MM dd yyyy');[/highlight]
Local Numbervar b :=Len(a);
Local Numbervar i;
Local Stringvar RESULT := ' ';
for i := 1 to b Step 1 do
RESULT := RESULT + mid(a, i,1) + ' ';
replace (RESULT, ' ', ' ')
As I said, it was only going to work if ({ARRFH.DOCDATE} was an actual date field. Is it possible that {ARRFH.DOCDATE} is a string rather than a date?
Try this:
Code:
WhilePrintingRecords;
Local StringVar a := {ARRFH.DOCDATE};
Local NumberVar b := Len(a);
Local NumberVar i;
Local StringVar RESULT := '';
for i := 1 to b Step 1 do
RESULT := RESULT + Mid(a, i,1) + ' ';
Replace(RESULT, ' ', ' ')
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.