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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

splitting a number into time

Status
Not open for further replies.

Paul1981

IS-IT--Management
Jun 30, 2006
36
0
0
GB
Hi,

Wonder if someone can help. I'm currently using Crystal Reports XI and want to split a number field into a time field.

The field format is 34512 (which is 3:45 and 12 seconds).

The solution must also take into accound if past 12 O'clock, the field reads- 133643 (which is 13:36 and 43 seconds)

With this in mind I need to be able to split the field from right to left. I am assuming I will create 3 new fields, and then populate a 'time' formula with the results. But is this the best way? and how? :)

Thanks
Paul
 
Try:

stringvar x := totext({table.number},"000000");
stringvar y := left(x,2)+":"+mid(x,3,2)+":"+right(x,2);
time(y)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top