Print Page | Close Window

converting military time

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=7343
Printed Date: 28 Apr 2024 at 5:30pm


Topic: converting military time
Posted By: gizmosilly
Subject: converting military time
Date Posted: 11 Aug 2009 at 12:06pm
I have data that I am trying to convert from Military time.  The data shows up like this 2359 so I created the following formula to put the Colon in the middle
if length ({RECMAST.TRANS_END_TIME}) =4 then
picture ({RECMAST.TRANS_END_TIME}, "XX:XX")
now the time shows up as 23:59
now i need to convert the military to regular time can someone please help me with this?



Replies:
Posted By: gizmosilly
Date Posted: 11 Aug 2009 at 1:30pm
That worked Thanks again!


Posted By: DBlank
Date Posted: 11 Aug 2009 at 1:31pm
deleted last post....
TIME(picture ({RECMAST.TRANS_END_TIME}, "XX:XX"))


Posted By: DBlank
Date Posted: 11 Aug 2009 at 1:45pm
if you have any that are 3 characters (H:MM) you may need another solution...
time( tonumber(left({RECMAST.TRANS_END_TIME},len({RECMAST.TRANS_END_TIME})-2)),   tonumber(right{RECMAST.TRANS_END_TIME},2)),00)



Print Page | Close Window