Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Posted: 07 Feb 2008 at 7:08am
The simplest method is to use the TOP keyword. So, suppose you want the most recent hundred entries. Have your SQL look like:
SELECT TOP 100 * FROM MyTable ORDER BY MyDate DESC
This can also be done in Crystal, using the Group Sort Expert. Unfortunately, it's a bit less straightforward, as you can't simply do a Top N on all the records. Instead, create a Group based on the unique ID of your records (hence, generating one "group" for each record). In the Group Footer, put a summary field for the Maximum of the date field in question. Then, use the Group Sort Expert to do your Top N.
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