No Sorting on a Group

cindyredo

Registered User.
Local time
Today, 23:16
Joined
Apr 23, 2001
Messages
16
I have a report that pulls from 2 tables with the following fields:

employeeid, lastname, firstname (table 1)
date, hoursworked (table 2)

I am trying to run a simple report that shows id, name and total hours for a given time period. in the report i need to group by employeeid, but want the report alphabetized by last name. i don't want to sort by the id number, as it is easier to look up a name if it is alpha. actually, the employeeid does not even have to print, but if i don't group by employee id, it sums different employees with the same last name.

any suggestions on how to remove the "sort" option in the sorting and grouping the report?

thanks.
 
You can't remove it. Create a calculated field in the query that concatenates lastName and EmployeeID. Specify this calculated field in the sorting and breaking options. It is not necessary to print the field so you don't need to have a control for it in order to make this work.

When changes are made to the report's underlying query, it is sometimes necessary to force the report to refresh it's fields collection. To do ths, modify and save the querydef. Then in design view, delete the querydef name from the report's Recordsource property. Move to a different property so the change will register and then go back to the RecordSource and paste the querydef name back. The report will then be able to "see" the new calculated field.
 
Actually there is a much easier way.

To differentiate between employees with the same last name, simply add 'firstname' to the sorting/grouping list and give it a group footer. Then do your sum calculation in that group footer instead of emloyeeID or lastname.
 
Thanks for the response. The concatenating of fields worked great!
 

Users who are viewing this thread

Back
Top Bottom