Print Page | Close Window

Sorting and limiting data

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15070
Printed Date: 14 Aug 2020 at 6:46am


Topic: Sorting and limiting data
Posted By: 9south
Subject: Sorting and limiting data
Date Posted: 02 Dec 2011 at 2:14am

I need to report on a work log, a string on information that is mostly broken by date time stamps.

My report requires the most current work entree to display, unfortunately I also display all of the data, this make the report unusable as each work log can be very large.

I have a sub report configured with the proper data field but cannot figure out how to sort the data to display last first and to truncate the display to only show 20 lines of the data




Replies:
Posted By: albazel2004
Date Posted: 13 Jan 2012 at 1:17am
You can select top 20 in your select query, some thing like this

select Top 20 *
from
(
select field1, field2
From Logfile_table
order by logtime desc
)

I hope it will help you.


-------------
Live with Peace



Print Page | Close Window