Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crystal formula to convert numeric field to time

Posted on 2014-03-30
2
Medium Priority
?
2,687 Views
Last Modified: 2014-03-30
I have a pervasive database with a time field that is in numeric value

13070614 = 1:07:06 pm and 14 milliseconds
9163401= 9:16:34 am and 01 milliseconds

I only need the hour and minute.

Can someone help me with a formula to convert to time for this?
0
Comment
Question by:Gerhardpet
2 Comments
 
LVL 23

Accepted Solution

by:
Ido Millet earned 2000 total points
ID: 39965379
StringVar sMyTime := ToText({your_numeric_column}, 0, "");

IF Len(sMyTime) = 8 Then
    cTime(sMyTime[1 to 2] & ":" & sMyTime[3 to 4] & ":" & sMyTime[5 to 6])
Else
    cTime(sMyTime[1] & ":" & sMyTime[2 to 3] & ":" & sMyTime[4 to 5]);
0
 
LVL 1

Author Comment

by:Gerhardpet
ID: 39965483
That works perfect! Thanks Ido.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we’ll look at how to deploy ProxySQL.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question