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

How do I extract the time from a string in CR? 1

Status
Not open for further replies.

madsstiig

Technical User
Jun 11, 2008
50
DK
Hi.
I'm working on a report (Crystal Reports XI)that uses a DB with a time field (called DOSR_STUDY.STUDY_TIME) that is actually a string (e.g. 101904.812000 is 10:19 a.m. and some seconds and milliseconds).
How do i extract that into an understandable time format like just 10:19?
 
If it always follows same format, ie first 4 characters are the time you can use.

@time
left(DOSR_STUDY.STUDY_TIME, 2)&":"&mid(DOSR_STUDY.STUDY_TIME,3, 2)

Ian
 
Thank you Ian.

That worked like a charm.
I know this is basic knowledge in CR but I don't get to use it that much...

Mads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top