Print Page | Close Window

Select last record from each group

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=19728
Printed Date: 27 Apr 2024 at 6:46am


Topic: Select last record from each group
Posted By: rusmanicai
Subject: Select last record from each group
Date Posted: 01 Jul 2013 at 3:46am
Good Morning!
I am trying to create a report of all employees and their last login process code.
I have three tables to work with:
1. Employee (PK EmployeeCode)
2. Production (PK Code-index key, assigned every time a new line is added to the table- not the employee code, although that field is part of the table structure)-lists all employees and all processes they clocked into for every day
3. ShopLogIn (PK EmployeeCode) - lists last time the employee clocked in with any process.
My report needs to show:
EmployeeName, EmployeeCode -Employee table
LastLoginTime-ShopLogIn table or Production table
LastProcess -Production Table

How can I get that? I grouped the records in the production table by employee code and in my details section I see all records for each employee, in descending order by the date stamp on each process they clocked into. How can I suppress everything except for the last process for each group?    

Thank you!
Julia.



Replies:
Posted By: hilfy
Date Posted: 01 Jul 2013 at 10:18am
Suppress the details section.  Put the detail data that you want to see in a Group Header section.  Since you've sorted in descending order, this will display the first set of detail data for the group.  If you had sorted in ascending order, you would put the data in the Group Footer section because the most recent date would be the last one in the group.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: rusmanicai
Date Posted: 01 Jul 2013 at 10:53am
Wow. I tried so many things, including this, but I have two groups, and I put the data in the first group (department) and not the second group (employee). Thank you!



Print Page | Close Window