Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: 1st record for each instance Post Reply Post New Topic
Author Message
clevername
Newbie
Newbie


Joined: 27 Nov 2007
Location: United States
Online Status: Offline
Posts: 4
Quote clevername Replybullet Topic: 1st record for each instance
    Posted: 27 Nov 2007 at 4:52pm
Hi.
 
I'm looking for a formula that will return the very first instance of an Event and its subsequent timestamp.
 
For instance I will have a day of events and each will have a timestamp...but I only want the first unique time each would occur.
 
e.g.
 
Event          Time
Arrival         11:34
Eat              11:36
Arrival          11:37
Sleep           11:45
Sleep           11:48
Eat              11:52
 
I only want to return the 11:34 - 11:36 - 11:45 events. I've played with various suppression techniques, but can't quite get it.  The times where an event occurs after another that isn't of its same type are the ones that are most troublesome. Help! and Thanks.


Edited by clevername - 27 Nov 2007 at 4:53pm
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 28 Nov 2007 at 2:33am

Hi

SELECT EVENT,MIN(TIME) FROM EVENT
GROUP BY EVENT

EVENT       TIME
ARRIVAL    11:34
EAT           11:36
SLEEP       11:45
I am not sure how you extracting the data for the report but you can
Use the above query .create a command object or create a view .....I have tested in Sql Server 2000
 
Cheers
Rahul
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.000 seconds.