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!

changing number field to time format - crystal 10

Status
Not open for further replies.

gruf1968

Technical User
Mar 22, 2006
3
GB
Can anybody tell me how to change a number field to show as dd:hh:mm:ss. I have a report showing me the average talk time of a call and it just shows as a number.

Thanks for you help in advance.

gruf
 
You should show what the number looks like and what it means, it doesn't take much time and this can vary. Plus, this isn't a time type if it includes days in it.

The database designers decided what the data stored would be, not Crystal, and not the people in this forum, please think your posts through and provide basic information to avoid wasting time.

If it's the number of seconds then you can use a dateadd("S") function, if it's stored as formatted periods within as in 12233005

which translates to: 12:23:30:05 then you'll convert it to a string and then parse it out:

Parse it out, as in:

whileprintingrecords;
Stringvar MyTime:=totext({table.field},0,"");
stringvar DD:= mid(MyTime,1,2);
stringvar HH:= mid(MyTime,4,2);
stringvar MM:= mid(MyTime,7,2);
stringvar SS:= mid(MyTime,10,2);

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top