Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: 24 hour daily time frame Post Reply Post New Topic
Author Message
Newbee
Newbie
Newbie
Avatar

Joined: 23 Jan 2012
Location: United States
Online Status: Offline
Posts: 2
Quote Newbee Replybullet Topic: 24 hour daily time frame
    Posted: 23 Jan 2012 at 8:32am

Cry Is there a way to have Crystal calculate time span between 7pm to 7pm, as one day.  In trying to measure our split shipments where I work.  Whenever we close a manifest, and 1 carton shipped at 8pm and the other at 8 am the next day, my current formula calcuates it as a split.  Cartons shipped on multiple days. 

The change I've been asked to make, is that if the cartons shipped within the 7-7 time frame, it's shouldn't calculate as a split.  Is this possible?
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 23 Jan 2012 at 9:06am
i assume that your current date field goes from 12 am to 12 am and
 you group on

you could try
create a formula like date(+7Hours)
dateadd("h",+7,{table.date})

then another formula like
 day(date(+7Hours)) + month(date(+7Hours)) + Year(date(+7Hours))
group on this formula ...
and it should work
IP IP Logged
Newbee
Newbie
Newbie
Avatar

Joined: 23 Jan 2012
Location: United States
Online Status: Offline
Posts: 2
Quote Newbee Replybullet Posted: 23 Jan 2012 at 10:59am
Sorry....I mistyped before, I meant the time span between 7 am to 7 am....as one day...instead of 12 am to 12am.
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 23 Jan 2012 at 11:27am
now that i think about my previous post doesn't solve your problem.
so the only way that i can think of is kind of manual
formula like
if {table.date carton shipped} in datetime(2011,1,1,7,0,0) to datetime(2011,1,2,7,0,0) then "2011/1/2"else
if {table.date carton shipped} in datetime(2011,1,2,7,0,0) to datetime(2011,1,3,7,0,0) then "2011/1/3" ...ETC
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 23 Jan 2012 at 3:40pm
Try creating a formula where you subtract 7 hours from the shipment datetime.  This means that any shipdate that's between midnight and 7 am will actually look like it's the previous day.  Use this formula for your calculations when checking for split shipments.
 
-Dell
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.016 seconds.