Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Last 5 Previous Records Post Reply Post New Topic
Author Message
vzh101
Groupie
Groupie
Avatar

Joined: 12 Feb 2015
Location: United States
Online Status: Offline
Posts: 46
Quote vzh101 Replybullet Topic: Last 5 Previous Records
     Posted: 09 Sep 2015 at 7:45am
I have a report that I want to pull the last 5 records in the Detail Section. there is no group. How can I go about doing that?

I want to show the last 5 previous appointments in the detail section. Is that possible?
IP IP Logged
praveeng
Senior Member
Senior Member
Avatar

Joined: 11 Jul 2011
Online Status: Offline
Posts: 165
Quote praveeng Replybullet Posted: 11 Sep 2015 at 1:14am
Hi,
If you are extracting data from database then you can simply use the following query.

SELECT TOP N * FROM Table ORDER BY Id DESC
OR
You can use this as the suppress formula in details section:
RecordNumber <= Count({database_field}) - 10.

--Praveen G
Praveen Guntuka,
praveen_guntuka@yahoo.com
IP IP Logged
vzh101
Groupie
Groupie
Avatar

Joined: 12 Feb 2015
Location: United States
Online Status: Offline
Posts: 46
Quote vzh101 Replybullet Posted: 13 Sep 2015 at 5:05pm
that worked! Thank you very much!
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