Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Cyrstal Formula for Time Constraints Post Reply Post New Topic
Author Message
stratosk17
Newbie
Newbie


Joined: 10 Jul 2012
Location: United States
Online Status: Offline
Posts: 3
Quote stratosk17 Replybullet Topic: Cyrstal Formula for Time Constraints
     Posted: 10 Jul 2012 at 8:00am

I have a report that displays shipment activity in a warehouse.  I need to create new a column that displays if a shipment was processed on time or past due.

 
The rules are that any shipment created before 3:00pm today must be shipped by 6:00pm on the same day, and any shipments that were created after 3:00pm must be shipped by 6:00pm the following day.
 
The new column would say 'On Time' or 'Past Due'.
 
I am using a creation datetime field, closed status datetime field and a formula that I created that calculates hours total that the shipment took to close.
 
Any help would be greatly appreciated!!  Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jul 2012 at 8:22am
if time(creation)<time(15,0,0) and datediff('d',creation,shipped)=0 and time(shipped)<time(18,0,0) then 'On Time'
else
if time(creation)>=time(15,0,0) and (datediff('d',creation,shipped)<0 or
(datediff('d',creation,shipped)=1 and time(shipped)<time(18,0,0))) then 'On Time'
else 'Past Due'
 
IP IP Logged
stratosk17
Newbie
Newbie


Joined: 10 Jul 2012
Location: United States
Online Status: Offline
Posts: 3
Quote stratosk17 Replybullet Posted: 10 Jul 2012 at 9:01am
DBlank,
 
This formula works perfectly...Thank you very much!  I beside myself at how quickly you resonded to my post!  Thank you again..
 
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