I want to convert a numeric field from AS/400 into a date field. the field format is for example "20021005" (2002=year, 10=month, 05=day)
Normaly i will do it with the following formula:
WhilePrintingRecords;
NumberVar input:= {PGNB01.DCRT01};
Date ( Val ( ToText (input,0,"" [1 to 4]),
Val (ToText (input,0,"" [5 to 6]),
Val (ToText (input,0,"" [7 to 8]))
The problem is that the numeric fiel in the AS/400 has different datas:
"20021005" (2002=year, 10=month, 05=day) or
"021005" (02=year 2002, 10=month, 05=day) or
"1005" (nothing=year 2000, 10=month, 05=day) or
"505" (nothing=year 2000, 5=month 05, 05=day)
"691005" (69=year 1969, 10=month, 05=day)
to solve the problem i have to break down the numeric data i think but i have no idea to do it!!
Has anybody some input for me?
Thanks very much
Normaly i will do it with the following formula:
WhilePrintingRecords;
NumberVar input:= {PGNB01.DCRT01};
Date ( Val ( ToText (input,0,"" [1 to 4]),
Val (ToText (input,0,"" [5 to 6]),
Val (ToText (input,0,"" [7 to 8]))
The problem is that the numeric fiel in the AS/400 has different datas:
"20021005" (2002=year, 10=month, 05=day) or
"021005" (02=year 2002, 10=month, 05=day) or
"1005" (nothing=year 2000, 10=month, 05=day) or
"505" (nothing=year 2000, 5=month 05, 05=day)
"691005" (69=year 1969, 10=month, 05=day)
to solve the problem i have to break down the numeric data i think but i have no idea to do it!!
Has anybody some input for me?
Thanks very much