Solved

Need Access 2007 Report to sort ASC

Posted on 2010-09-13
7
619 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
  • 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now