Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: report only the latest entry and filter by pastdue Post Reply Post New Topic
Author Message
ddallas
Newbie
Newbie
Avatar

Joined: 13 Jan 2011
Location: United States
Online Status: Offline
Posts: 1
Quote ddallas Replybullet Topic: report only the latest entry and filter by pastdue
     Posted: 13 Jan 2011 at 10:58am
I am struggling with creating a report that shows only the latest entry to a record then filter out records where the entry was created within X number of days.

example where sysdate is 1/13/2011:
DATA STRUCTURE (2 tables, jobs & entries)
123 job1
-1/1/2011 accepted job
-1/2/2011 created drawings
-1/3/2011 assigned crew
124 job2
-1/8/2011 accepted job
-1/9/2011 created drawings

RETURN LAST ENTRY ONLY
123 job1
-1/3/2011 assigned crew
124 job2
-1/9/2011 created drawings

FILTER JOBS if last entry date was greater then 5 days ago.RESULTS:
123 job1
-1/3/2011 assigned crew
-----
i have a group formula {table.dateentered} = Maximum ({table.dateentered},{table.jobid}) that works perfect for returning the last entered record for each job. when i attempt to filter out the job based on the last record, the next to last record appears if it meets the filter criteria, thus not eliminating the job. meaning if the last record gets filtered out because it is within 5 days, the next record shows because it is beyond 5 days.

what is the best way to accomplish this?
thanks,
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Jan 2011 at 11:39am
your filter has to be at the group
int the select expert there is a toggle for "Record Selection" or "Group selection"
switch it to group selection then add your seelct criteria there
Maximum ({table.dateentered},{table.jobid}) >= dateadd('d',-5, currentdate)
 
note the group selections will show all groups in teh group tree but only groups that meet the criteria in the report body
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