• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2772
  • Last Modified:

Crystal formula to convert numeric field to time

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?
1 Solution
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
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])
    cTime(sMyTime[1] & ":" & sMyTime[2 to 3] & ":" & sMyTime[4 to 5]);
GerhardpetAuthor Commented:
That works perfect! Thanks Ido.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now