hi all,
this is what i want to achieve:
(Location) (From) (To) (Visit Length)
1/5/03
XXXXXX 00:00 07:30 07:30
XXXXXX 08:16 17:31 09:15
XXXXXX 18:02 00:00 05:58
2/5/03
XXXXXX 00:00 07:00 07:00
XXXXXX 08:37 17:31 08:54
ETC.....
this is what i am getting:
(Location) (From) (To) (Visit Length)
1/5/03
XXXXXX 08:16 17:31 09:15
XXXXXX 18:02 00:00 05:58
2/5/03
XXXXXX 08:37 17:31 08:54
As you can see, midnight to the next morning isn't showing up...
The formulas i am using are:
@SetStartTime :
whileprintingrecords;
global datetimevar StartTime;
local timevar send_time := {?Shift End Time};
if ( send_time = time(0,0,0) ) then
send_time := time(23,59,59);
if ( OnLastRecord ) then
StartTime := datetime(date({@LocalGPSDATETIME}),send_time)
else if ( date({@LocalGPSDATETIME}) <> date({@LocalTimeNext}) ) then
StartTime := datetime(date({@LocalGPSDATETIME}),send_time)
else if ( {journey_events.LOC_ID} <> next({journey_events.LOC_ID}) ) then
StartTime:={@LocalGPSDATETIME};
StartTime;
@SetStopTime :
whileprintingrecords;
global datetimevar StopTime;
global datetimevar StartTime;
if ( OnFirstRecord )
or ( date({@LocalGPSDATETIME}) <> date({@LocalTimePrev}) )
or ( {journey_events.LOC_ID} <> previous({journey_events.LOC_ID}) ) then
(
StopTime:= {@LocalGPSDATETIME};
StartTime := StopTime;
);
StopTime;
Let me know if you need any more info on other formula's etc.
Thanks,
B
this is what i want to achieve:
(Location) (From) (To) (Visit Length)
1/5/03
XXXXXX 00:00 07:30 07:30
XXXXXX 08:16 17:31 09:15
XXXXXX 18:02 00:00 05:58
2/5/03
XXXXXX 00:00 07:00 07:00
XXXXXX 08:37 17:31 08:54
ETC.....
this is what i am getting:
(Location) (From) (To) (Visit Length)
1/5/03
XXXXXX 08:16 17:31 09:15
XXXXXX 18:02 00:00 05:58
2/5/03
XXXXXX 08:37 17:31 08:54
As you can see, midnight to the next morning isn't showing up...
The formulas i am using are:
@SetStartTime :
whileprintingrecords;
global datetimevar StartTime;
local timevar send_time := {?Shift End Time};
if ( send_time = time(0,0,0) ) then
send_time := time(23,59,59);
if ( OnLastRecord ) then
StartTime := datetime(date({@LocalGPSDATETIME}),send_time)
else if ( date({@LocalGPSDATETIME}) <> date({@LocalTimeNext}) ) then
StartTime := datetime(date({@LocalGPSDATETIME}),send_time)
else if ( {journey_events.LOC_ID} <> next({journey_events.LOC_ID}) ) then
StartTime:={@LocalGPSDATETIME};
StartTime;
@SetStopTime :
whileprintingrecords;
global datetimevar StopTime;
global datetimevar StartTime;
if ( OnFirstRecord )
or ( date({@LocalGPSDATETIME}) <> date({@LocalTimePrev}) )
or ( {journey_events.LOC_ID} <> previous({journey_events.LOC_ID}) ) then
(
StopTime:= {@LocalGPSDATETIME};
StartTime := StopTime;
);
StopTime;
Let me know if you need any more info on other formula's etc.
Thanks,
B