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?
ThanksSelect 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.|||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.|||What is the database you are using?
Post table structures, sample data and the result you want
No comments:
Post a Comment