Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Date / Time Conversion Question

Here we go again.. I hate working with old IBM Data. I have a filed it is a string this time, that stores the date it is 6 long to handle 235959 = 11:25:59 pm. however sometime as in now it has a value of 63123 = 6:31:23am i have the following equation:

stringvar a:=totext({TAGDTL.CREATION_TIME},0,'');

numbervar h:= tonumber ( a [1 to 2] );

numbervar mm:= tonumber ( a [3 to 4] );

time(h, mm, 0)

this works great as long as I have all 6 field filled. When I do not then the example of 63123(6:30:23am)

comes in and the h in time = 63 and I get an error.

Any suggestions would be appricated...

Jim

replied

James,

Try putting it in a control statement based on the length of the string. For example;

If length() = 5 then h[1] else h[1 to 2]

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question