Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting and Grouping Order

Status
Not open for further replies.

summer01

Technical User
Jan 28, 2008
19
US
Having a problem with my sort order, which is probably something very simple that I am not seeing. The query works great but the report is a bit of a problem. In the case of Duplicate names that have a Jr. and Sr. following them in the last name field, it is grouping everything under one of the names rather than separately. If I add "active contract #" as a primary sort/group header, the names are spearated correctly but the alpha sort by last name is not occuring. If I make it the 2nd group header and file name first, it agains combines the duplicate names. How can I make this work so it sorts by Last name first and keeps the duplicate names separate? Below is the SQL of my original query that makes up my report.

SELECT Trim([MemberLast]) & ", " & Trim([Member]) AS FileName, qry_ComplianceCurrStatDte.CatName, AutocamMembers.ActiveContractNum, qry_ComplianceCurrStatDte.CatID
FROM AutocamMembers INNER JOIN qry_ComplianceCurrStatDte ON (AutocamMembers.CONTRACT_NUM = qry_ComplianceCurrStatDte.ContractNum) AND (AutocamMembers.MemRelCde = qry_ComplianceCurrStatDte.RelCode)
WHERE (((qry_ComplianceCurrStatDte.LastOfCompliant)="no" Or (qry_ComplianceCurrStatDte.LastOfCompliant)="unknown"))
GROUP BY Trim([MemberLast]) & ", " & Trim([Member]), qry_ComplianceCurrStatDte.CatName, AutocamMembers.ActiveContractNum, qry_ComplianceCurrStatDte.CatID;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top