Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Covert String to Time Post Reply Post New Topic
Author Message
ridershaun
Newbie
Newbie


Joined: 31 Aug 2010
Online Status: Offline
Posts: 32
Quote ridershaun Replybullet Topic: Covert String to Time
    Posted: 05 Dec 2016 at 8:23am
I have a time value in my table of 1248520000 which represents 12:48:52:00:00 that I want to convert to a AM/PM time value in my report. I have tried multiple codes and all I end up with is 12:00:00 AM. Any help would be appreciated.

Thank You
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 05 Dec 2016 at 9:21am
I think you would have to convert it to a string, then insert colons in the correct places.  Not sure how to determine AM/PM

Example:

Stringvar date_time := totext({datetime},,0,'');

left(date_time,2)+':'+mid(date_time,4)+':'+mid(date_time,6)
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.