Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can Crystal Report export tab delimited file with 2400+ hrs clock or with 'x' after time?

Status
Not open for further replies.

capronton

MIS
Jun 28, 2013
159
0
0
US
Can Crystal Report export tab delimited file with 2400+ hrs clock or with 'x' after time?

See example below:

rail_id vehicle_id oDate cDate tDate rte blk ons offs max startTrip veh_long
103 11103 23:41:43 23:41:58 8/1/2014 550 550004 6 0 14 22:54:00 -97.7197
103 10103 23:43:35 23:43:46 8/1/2014 550 550004 0 0 0 22:54:00 -97.7163
103 11103 23:43:35 23:43:46 8/1/2014 550 550004 0 0 14 22:54:00 -97.7161
103 11103 23:50:10 23:50:38 8/1/2014 550 550004 1 0 15 22:54:00 -97.709
103 10103 23:50:10 23:50:39 8/1/2014 550 550004 0 0 0 22:54:00 -97.7092
103 11103 23:56:48 23:57:14 8/1/2014 550 550004 0 1 14 22:54:00 -97.7275
103 10103 23:56:48 23:57:15 8/1/2014 550 550004 0 1 0 22:54:00 -97.7279
103 11103 0:30:39 0:30:39 8/1/2014 550 550004 0 0 0 0:30:00 -97.7379
103 11103 1:26:38 1:28:08 8/1/2014 550 550004 0 6 20 0:30:00 -97.8558
103 11103 1:33:51 1:33:51 8/1/2014 550 550004 0 0 0 1:23:00 -97.8547


 
Perhaps I do not understand the question, but have you tried right-clicking the field, choosing "format field" and changing the time for a 24-hour clock?
 
Sorry for the confusion. I need a formula to change the time-fields below

103 11103 0:30:39 0:30:39 8/1/2014 550 550004 0 0 0 0:30:00 -97.7379
103 11103 1:26:38 1:28:08 8/1/2014 550 550004 0 6 20 0:30:00 -97.8558
103 11103 1:33:51 1:33:51 8/1/2014 550 550004 0 0 0 1:23:00 -97.8547

0:30:39 to 24:30:29
1:26:38 to 25:26:38
2:45:22 to 26:45:22

Some of our buses/trains run 9pm at night to 3am in the morning. I need the morning 3am to say 2700 hours.

Thanks.
 
Okay, I think that this needs to be done with a formula. Why not try the following:

Code:
Local StringVar Array t := split(totext(time({FIELD NAME HERE}),"H:mm:ss"),":");

if tonumber(t[1]) < 4 then 
    t[1] := totext((tonumber(t[1]) + 24),0);

t[1] + ":" + t[2] + ":" + t[3];

Just replace the "FIELD NAME HERE" with the proper field. The formula does the following:

1. Convert the 24-hour click to a string (instead of a date value)
2. "Split" the time into an array, splitting at each colon (so 3:13:04 comes into three values - 3, 13, and 04).
3. Check the numerical value of the first result (in this case, the "3"). If it is less than 4, then add 24 to it.
4. Re-form the values into something that resembles the 24-hour clock: 27:13:04.
 
formula time24:
val(totext({time filed},"HHmm"))

formula timeadj:
if {@time24) < 400
then {@time24} +2400
else {@time24}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top