Skip to Content
author's profile photo Former Member
Former Member

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...


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Oct 10, 2008 at 08:31 PM


    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]

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.