Kamis, 15 September 2011

[MS_AccessPros] Sorting and Grouping on a Report

 

I ran into a bit of a dilemma with a report. This is the query behind the report:

SELECT qryApplicantExtended.ApplicantID, qryApplicantExtended.[Applicant Name], tlkpRoomCount.RoomCountName, tlkpApplicationStatusType.ApplicationStatusTypeName, tblApplicationStatus.StatusDate, tlkpRoomCount.SortOrder
FROM (qryApplicantExtended INNER JOIN (((tblApplication INNER JOIN tblApplicationReview ON tblApplication.ApplicationID = tblApplicationReview.ApplicationID) INNER JOIN tblApplicationStatus ON tblApplication.ApplicationID = tblApplicationStatus.ApplicationID) INNER JOIN tlkpApplicationStatusType ON tblApplicationStatus.ApplicationStatusTypeID = tlkpApplicationStatusType.ApplicationStatusTypeID) ON qryApplicantExtended.ApplicantID = tblApplication.ApplicantID) INNER JOIN tlkpRoomCount ON tblApplicationReview.RoomCountID = tlkpRoomCount.RoomCountID
WHERE (((tblApplicationStatus.ApplicationStatusTypeID)=3))
ORDER BY tlkpRoomCount.SortOrder;

On my report I have it grouped by the RoomCountName which breaks up the report starting with the RoomCountName = "Five". I added a field called SortOrder to tlkpRoomCount so the table looks like this:

RoomCountID RoomCountName SortOrder
1 Five 6
2 Four 5
3 One 1
4 One or two 2
5 Pending 7
6 Three 4
7 Two 3
8 None (Denied) 8

but the issue is I needed the report sorted by oldest StatusDate first which this does right now but I want the grouping in the correct order so its grouped like One, One or Two, Two, etc. basic by the SortOrder field.

Any ideas?

Art Lorenzini
Sioux Falls, SD

__._,_.___
Recent Activity:
MARKETPLACE
A bad score is 598. A bad idea is not checking yours, at freecreditscore.com.

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar