Solved

Need Access 2007 Report to sort ASC

Posted on 2010-09-13
7
625 Views
Last Modified: 2012-05-10
Greetings:

I have created a report in an Access 2007 database. My Report source SQL statement is below. In the attached screenshot, you can see that teh report is a listing of employees by Manager. The Manager field is being fed by the alias shown below. I want the Managers to sort ASC by the Manager's last name. I tried adding ASC to the statement below, with no luck. Any idea what I am doing wrong?

SELECT tbl_Employees.*, tbl_Managers.[Lname] & ", " & tbl_Managers.[Fname] AS MgrName
FROM tbl_Managers INNER JOIN tbl_Employees ON tbl_Managers.ID = tbl_Employees.ManagerID
ORDER BY tbl_Managers.Lname, tbl_Managers.Fname;

reportscreenshot.jpg
0
Comment
Question by:smsdesigns
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 167 total points
ID: 33661707
The sort order in the SQL statement is of no use.  You need to set up a Sort Order within your report.

Opent the report in design view, click the Group&Sort icon on the ribbon bar.

Click the Add a Sort button. then select the appropriate field from the dropdown list.
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 167 total points
ID: 33661734
in the design view of the report, click on the Sorting and Grouping and enter the Field name in the Sorting  and Grouping Window
0
 
LVL 19

Assisted Solution

by:MINDSUPERB
MINDSUPERB earned 166 total points
ID: 33661751
smsdesigns,

The steps below may help you achieve what you want for your report:

1. In Report Design View, Click the design tab
2. Select Group and Sort in Grouping and Totals Group
3. You can work around grouping and sorting in the Group, sort and Total window at the bottom part of the window.

Do hope those steps help you.

Sincerely,

Ed
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 33661758
you may need to include to your SQL statement the fields LName and FName


SELECT tbl_Employees.*, tbl_Managers.[Lname] & ", " & tbl_Managers.[Fname] AS MgrName, LName,FName
FROM tbl_Managers INNER JOIN tbl_Employees ON tbl_Managers.ID = tbl_Employees.ManagerID
0
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 33661783
smsdesigns,

Please disregard my post. It's a duplication with other EE's post.

I am sorry fyed and carpricorn1.

Sincerely,

Ed
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 33661798
NP...
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 33661839
Happens all the time.  

What I hate is when I start a response when there are no others posted, get sidetracked, and 30 minutes later complete my response and hit send, then see that 3 or 4 others have already posted the same response.  
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question