|
-
October 19th, 2005, 08:25 AM
#1
Displaying first instance of data
Hi,
I'm having some trouble with a report I'm trying to generate. It is essentially activity status of a bunch of users that are on the system. The raw data displays the date and time, user, what state they are currently in and what state they changed to and duration.
My problem is I only need the first and last instance for each day. Since a user can go through many states in a day, the data is quite long and to have to filter through the data by hand is quite cumbersome.
Is there a way display the data but just show only the first instance for that date and last instance for the date assuming i have a parameter that is a date range?
Thanks
-
October 19th, 2005, 09:06 AM
#2
Re: Displaying first instance of data
Select top 1 [fieldnames ...] from [Tablename] ..... Order by Primary key desc
delievers the first and
Select top 1 [fieldnames ...] from [Tablename] ..... Order by [Primary key] asc
delievers the last entry.
have a nice day
Patzer
_____________________________
Philo will never be forgotten
-
October 26th, 2005, 01:31 PM
#3
Re: Displaying first instance of data
I'm not quite sure where to put this:
Here is more information on the problem.
I have 3 group names. First is Name, second is time (Day MM/DD/YY), third is time (H:MM)
What I would like to do is for each day, calculate the maximum and minimum of the time
However when I do Minimum (Date) I get the minimum of ALL the days, and not just for that particular date.
For example, my data has 8 users, and has data for about 30 days on each user. Each day a user can have multiple activities, ranging from 8am to 6pm. All I want to calculate or see, is the first time and the last time for that particular day
Any ideas? I'm trying to create a formula using the minimum function but to no avail.
-
November 19th, 2005, 08:18 AM
#4
Re: Displaying first instance of data
What is the database you are using?
Post table structures, sample data and the result you want
Madhivanan
Failing to plan is Planning to fail
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|