cancel
Showing results for 
Search instead for 
Did you mean: 

Date / Time Conversion Question

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member260594
Active Contributor
0 Kudos

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]

Answers (0)