Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Date Missing Problem Post Reply Post New Topic
Author Message
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Topic: Date Missing Problem
     Posted: 25 Feb 2014 at 9:23am
I created a report that I was wondering how I could reset a running total with a missing date. Example of the report is follows.

Group by Name

02/18/14    Huber Release     0.00
02/19/14    Huber Release     1.00
02/20/14    Huber Release     1.00
02/21/14    Huber Release     1.00
02/24/14    Huber Release     1.00
02/25/14    Huber Release     1.00

Running Total Sum : 5.00

I used the formula:
if ({Audit_Trail.AfterValue} ="Huber Release"
and {Audit_Trail.DateStamp} <= currentdate-7)
then 0
else 1

But is there a way to reset for the days missing (02/22/14 and 02/23/14) for a running total of 2.00

Thank you for the help!
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 25 Feb 2014 at 9:58am
If there are no breaks like for weekends and holidays, maybe.  It would required the previous and dateadd functions.
IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 25 Feb 2014 at 10:33am
There are no holidays or weekends. What would the formula be with the dateadd function?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 25 Feb 2014 at 1:21pm
I would think if you using formulas to do a manual running total then the formula might look something like this

shared numbervar somecounter;
if datediff(d,previous({Audit_Trail.DateStamp},{Audit_Trail.DateStamp}) <>1 then somecounter := somecounter +1

You would need another formula to show the counter
shared numbervar somecounter;

I think this is what your are trying achieve.  I could be mistaken.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Feb 2014 at 3:31pm
in a crystal running total you would use kevray's formula
 
datediff(d,previous({Audit_Trail.DateStamp},{Audit_Trail.DateStamp}) <>1
 
as a the formula in the reset section
 
 
IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 28 Feb 2014 at 5:54am
I tried using the above formula and I keep getting the ") missing ". Is the formula wrote right?

datediff(d,previous({Audit_Trail.DateStamp},{Audit_Trail.DateStamp}) <>1
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Feb 2014 at 6:28am
sorry about that
 
datediff("d",previous({Audit_Trail.DateStamp}),{Audit_Trail.DateStamp}) <>1
 


Edited by DBlank - 28 Feb 2014 at 6:30am
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