Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Query on database Post Reply Post New Topic
Author Message
Extractor
Newbie
Newbie


Joined: 28 Sep 2010
Location: Netherlands
Online Status: Offline
Posts: 3
Quote Extractor Replybullet Topic: Query on database
     Posted: 27 Feb 2012 at 3:59am
Hi all,
 
I'm having an issue.
 
I have a table with 2 PK's (DocumentNr & VersionNr). For each new version the DocumentNr stays the same, but the version will differ.
 
The issue I'm having, in my report I only want to show items of the highest version.
 
If a DocumentNr has 3 versions, there are 3 rows. But I only want to see the 3th version and the first 2 not.
 
Is there an option as MAX?
 
Thank you in advance!


Edited by Extractor - 27 Feb 2012 at 4:07am
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 27 Feb 2012 at 4:04am
Group by documentnr.
 
Create a formula as follows;
{table.versionnr} = maximum({table.version.nr},{table.documentnr})
 
In your record selection expert set to only return where the above formula is true.
 
Regards,
Ryan.
IP IP Logged
Extractor
Newbie
Newbie


Joined: 28 Sep 2010
Location: Netherlands
Online Status: Offline
Posts: 3
Quote Extractor Replybullet Posted: 27 Feb 2012 at 8:16pm
Hi,
 
Thank you for the quick and very helpfull reply!
 
Smile
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