Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: how to extract specific data ?? Post Reply Post New Topic
Author Message
dimmu
Newbie
Newbie
Avatar

Joined: 24 Jan 2009
Location: Morocco
Online Status: Offline
Posts: 8
Quote dimmu Replybullet Topic: how to extract specific data ??
     Posted: 27 Jan 2009 at 2:23pm
Hello everyone,

i try to extract some data from two tables :  call, activity.
many activities can be done on one call under a status, so i try to pull out how much time was spend in an activity under a certain status.

call table :   *id_call, receved_date, closed_date.
activity table : *id_activity, begin_date, begin_time, end_date, end_time, stauts, #id_call


i will make an example :

call 1 :   id_call=B21, receved_date=02/02/2009,closed_date=05/02/2009

activity1 : id_activity=02ZE, begin_date=02/02/2009, begin_time=11:10,end_date=02/02/2009, end_time=11:30, status=open, id_call=B21.
activity2 : id_activity=03ZE, begin_date=02/02/2009, begin_time=12:10,end_date=02/02/2009, end_time=12:30, status=open, id_call=B21.
activity3 : id_activity=02ZE, begin_date=02/02/2009, begin_time=14:10,end_date=02/02/2009, end_time=14:30, status=open, id_call=B21.


i have already made a report which pull all the activities of each call grouped by status, so what i want to do is calculating the duration from the first activity untill the last under the status "Open".
i have the function which takes care of calculating the duration between two dates, i just need to know how can i pull out the first date and the last date of each group and give it to the function so it calculates the duration ???

in my case i need to pull out:
                                        begin_date=02/02/2009, begin_time=11:10 
And
                                         end_date=02/02/2009, end_time=14:30.


thank you for your help.

Edited by dimmu - 27 Jan 2009 at 2:24pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 28 Jan 2009 at 7:10am
I am guessing that the data is already grouped by the call and ordered by the begintime.  I am assuming that the begin time cannot overlap the endtime.
 
Here, let's just say that records are grouped by call, no specific ordering.  I would have 3 formulae, 1 to reset the value to 0, 1 to display/calculate results, and 1 to do all the work.  By all the work, it would be on the detail line, it would ask if the begin_time was less than the stored value, if yes, update, othewise nothing.  Is the end_time greater than the stored value, if so update otherwise nothing.  In the group footer you could now select the begin and end times of the call.
 
Hope this helps
IP IP Logged
dimmu
Newbie
Newbie
Avatar

Joined: 24 Jan 2009
Location: Morocco
Online Status: Offline
Posts: 8
Quote dimmu Replybullet Posted: 28 Jan 2009 at 11:14am
hello lockwelle,

thank you for your answer but i guess i couldn't understand cuz i'm really new to crystal report.

can you please exmplain a lttile more ??

what i need to do is to calculate the duration of time from the begin_date of the first row until the end_date of the last row under each call status.

the data is grouped under two groups the first one is by Call_Id an then grouped by Status.

thank you a lot
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