Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: String to Text conversion Post Reply Post New Topic
Author Message
regism
Newbie
Newbie


Joined: 05 Dec 2007
Online Status: Offline
Posts: 4
Quote regism Replybullet Topic: String to Text conversion
     Posted: 09 Jan 2008 at 4:32am
I grabbed the time a interaction was queue from a calllog doing the following:
 
If (Instr ({CallDetail.CallEventLog},"Entered Workgroup")>0)
then
Mid ({CallDetail.CallEventLog}, InStr ({CallDetail.CallEventLog}, "Entered Workgroup")- 10,8)
Else
   "Not Assigned to Queue"
 
the result is like AB:CD:EF:GH
 
and the time the interaction was ended doing the following:
 
If (Instr ({CallDetail.CallEventLog},": Remote Disconnect")>0)
then
Mid ({CallDetail.CallEventLog}, InStr ({CallDetail.CallEventLog}, ": Remote Disconnect")- 8,8)
Else
    "N/A"
 
the result is like AB:CD:EF:GH
 
My problem is that I need to calculate the difference between those 2 "times" which are after this formula strings.
 
So what I need to do is convert each those 2 formula result into strings.
 
So I need to find a way to covert each result AB:CD:EF:GH  to time where:
 
AB= HH (hours)
CD= MM (minutes)
EF= SS (seconds)
 
Can you please help me on this?
 
Thanks,
 
Regis
 


Edited by regism - 09 Jan 2008 at 4:33am
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 09 Jan 2008 at 4:39am
I assume GH, then, would be tenths and hundredths of seconds?  Seems like unnecessary levels of precision to me, but probably not relevant to your question.

Have you tried using the CTime function?  If you change the colon between EF and GH to a period, that should be exactly the format it is looking for.

You may also want to use the IsTime function to check and see if your string is in a recognizable time format before running it through CTime.


IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum