Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: View only the last record Post Reply Post New Topic
Author Message
jordanofmn
Newbie
Newbie


Joined: 06 Apr 2010
Online Status: Offline
Posts: 10
Quote jordanofmn Replybullet Topic: View only the last record
     Posted: 12 Apr 2010 at 7:16am
How can I display only the latest dated record value from the database?
For example, I wish to see the last order of all customers.
 
Thanks in advance,
Cj
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 12 Apr 2010 at 8:27am
There are a couple of ways you can do this.
 
1.  Group by customer.  Sort by Order Date descending.  Put all of your data in the Customer group header.  This is the easiest to set up but if you want order details, you may have to use a subreport to display them.
 
2.  Use a command instead of tables to provide data for your report.  Write the SQL so that you only pull the most recent for each customer.  You have to know SQL to do this one, although there should be no need for a subreport here.
 
-Dell
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