Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Select latest date Post Reply Post New Topic
Author Message
trub
Newbie
Newbie
Avatar

Joined: 16 Aug 2011
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote trub Replybullet Topic: Select latest date
     Posted: 01 Sep 2011 at 4:51am
Hi,

I have a range of data (all prior to current YTD) for which I would like to show only the latest record per item. 
Selecting the maximum is showing me the correct latest date and I would have thought simply disabling the date column would then leave me with only the 1 line.
 
In total I have 206000 lines of data which should be compressable into 15000 or so, so you can see the issue.

Help?
trub
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Sep 2011 at 5:07am
do you want to only select that data? if so you would need to use a command or somehting akin to a sql view or stored procedure.
If you are only concerned with displaying dat you can
group on the "item"
sort on the date field descending
palce the fields date field in the group header
hide your details and group footer
IP IP Logged
trub
Newbie
Newbie
Avatar

Joined: 16 Aug 2011
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote trub Replybullet Posted: 01 Sep 2011 at 5:13am

Blooming heck, thanks!

works perfectly and think you've just opened up a whole new window for me.

 

thanks again

trub
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Sep 2011 at 5:21am

a couple of thing sto note.

-hiding data does not remove it formthe report so dat ais still included in your calcuations unless you explicitly exclude them using variable formulas or running totals.
- whenever yuo place table fields on headers it will display the first record that exists after that header is preinted (e.g. the first row of a group or the report). If you place a field int he footer is displays the last row of data before that footer is printed (e.g. the last row of a group or the last row of a report).
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