Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Displaying cases not modified over 7 days Post Reply Post New Topic
Author Message
skyliner34
Newbie
Newbie


Joined: 20 Oct 2011
Online Status: Offline
Posts: 18
Quote skyliner34 Replybullet Topic: Displaying cases not modified over 7 days
    Posted: 16 Feb 2012 at 10:42pm
Hello,
 
   I have created a simple report that will display all cases assigned to a certain group showing the last modified date, I then manually remove all records that have been updated within the last 7 days which produces a figure of 165.
 
To remove this manual process I have added a statement '< currentdate -7' which should display all cases not updated older than 7 days, but it isnt. The figure produced here is 130 and cases that should appear because of their age are not shown.
 
So I am needing to display all cases that have not been updated older than 7 days, am I missing something?
 
 
 
 


Edited by skyliner34 - 17 Feb 2012 at 3:22am
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 17 Feb 2012 at 2:11am
in Reports>Selection Formulas>Record try:

{table.modifieddate}<dateadd('d', -7, currentdate)


Edited by FrnhtGLI - 17 Feb 2012 at 2:13am
|< /\ '][' ( )
IP IP Logged
skyliner34
Newbie
Newbie


Joined: 20 Oct 2011
Online Status: Offline
Posts: 18
Quote skyliner34 Replybullet Posted: 17 Feb 2012 at 3:32am
Many thanks, sorry to say though that the figure returned is still too low.
 
For example, if I run the same report with no date range filtering and then manually remove calls modified in the last 7 days I get 165, several from 2010 are included
 
then if I add the comment
{HPD_HelpDesk.Modified_Time} < dateadd ('d', -7, currentdate)
 
or
 
{HPD_HelpDesk.Modified_Time} < currentdate -7
 
the report produces 130 results and the ones from 2010 that were present are now missing, along with 30 or so others??
 


Edited by skyliner34 - 17 Feb 2012 at 3:40am
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 17 Feb 2012 at 4:00am
does it need to be included that the date could be equal to or less than the current date -7?

Not sure why it wouldn't pull the records from 2010 with that statement. It's only telling Crystal to ignore those dates that are within seven days of the current date. Is there any other selection you are doing? Any suppression formulas that may be affecting the outcome?




|< /\ '][' ( )
IP IP Logged
skyliner34
Newbie
Newbie


Joined: 20 Oct 2011
Online Status: Offline
Posts: 18
Quote skyliner34 Replybullet Posted: 17 Feb 2012 at 4:34am
The only other selection is to tell the report which team to query (which doesnt change). Its a bit of a strange one, possibly the simplest report I have ever written, but also the most frustrating as the statement should work fine.
I will ditch the report and start again, just incase anything has crept in there.
IP IP Logged
skyliner34
Newbie
Newbie


Joined: 20 Oct 2011
Online Status: Offline
Posts: 18
Quote skyliner34 Replybullet Posted: 17 Feb 2012 at 5:21am
Created new report, but same results, quite weird!
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 17 Feb 2012 at 5:28am
I'd start by isolating the 35~ cases which aren't included but should be.
 
Once you've done that, create a new formula as follows and drag it into the dataset - this should give us some idea of what's causing the problem.
 
today - {table.datefield}
 
Once we know why they're being incorrectly excluded we can begin to help you fix it.
 
Regards,
Ryan.
 
Basically, let us know what the dates are on those 35~ records. I'm guessing your field is datetime not date datatype from it's description so I'm thinking it's probably something like you want <= currentdate -7 at 00:00:00.
 
Try;
 
{HPD_HelpDesk.Modified_Time} <= dateadd("d",datediff("d", #01/01/1901#, currentdate())-7,#01/01/1901#)


Edited by rkrowland - 17 Feb 2012 at 5:55am
IP IP Logged
skyliner34
Newbie
Newbie


Joined: 20 Oct 2011
Online Status: Offline
Posts: 18
Quote skyliner34 Replybullet Posted: 19 Feb 2012 at 11:09pm
Thank you for your reply. Using the formula you have supplied I can now get the reports to balance nicely. thanks again :)

Edited by skyliner34 - 19 Feb 2012 at 11:33pm
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.