Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Time Difference Post Reply Post New Topic
Author Message
dhakshu
Newbie
Newbie
Avatar

Joined: 01 Mar 2007
Location: Singapore
Online Status: Offline
Posts: 21
Quote dhakshu Replybullet Topic: Time Difference
    Posted: 11 Jun 2007 at 1:16am

Hi All!

 
I need to find the difference between the airtime of current record and next record.
When I try to run the report, I get Bad Time format String error.
I use the following formula:-
--------------------------------------------------------------------------------------
LOCAL DATETIMEVAR D1;
LOCAL DATETIMEVAR D2;
D1:=DATETIMEVALUE(CDATE({Command.AIR_DATE}),CTIME(currentfieldvalue));

IF NEXT({Command.AIR_TIME}) <> "" THEN
  D2:=DATETIMEVALUE(CDATE(NEXT({Command.AIR_DATE})),CTIME(NEXT({Command.AIR_TIME})))
 
if not onlastrecord and next({Command.AIR_TIME}) <> "" then
cstr(datediff("n",D1,D2))
ELSE
CSTR({Command.EVENT_DURATION});
----------------------------------------------------------------------------
 
Thanks
dhakshu


Edited by dhakshu - 11 Jun 2007 at 1:22am
Dhakshu
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.