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!

Sort Order by Month 1

Status
Not open for further replies.

houstonbill

Technical User
Nov 6, 2006
92
I have been struggling for 2 days over something that should be so easy. I have a report based on a query as follows:

SELECT QryOnSite.FirstName, QryOnSite.LastName, Sum(QryOnSite.CountOfOnSite) AS SumOfCountOfOnSite, QryOnSite.[Employee ID], Sum(QryOnSite.[Visit Duration]) AS [SumOfVisit Duration], QryOnSite.Name, Format$([CallDate],"mmmm yyyy",0,0) AS MoEnd
FROM QryOnSite
GROUP BY QryOnSite.FirstName, QryOnSite.LastName, QryOnSite.[Employee ID], QryOnSite.Name, Format$([CallDate],"mmmm yyyy",0,0);

I cannot seem to get my report to go with Jan, Feb, etc. It is either ascending starting with April or decending. My sorting and grouping for the report has "Name" as the primary sort with "MoEnd" as my secondary sort - ascending. I have tried everything. Any thoughts??
 
Put a value in your query that you can sort by:
Code:
SELECT QryOnSite.FirstName, QryOnSite.LastName, Sum(QryOnSite.CountOfOnSite) AS SumOfCountOfOnSite, QryOnSite.[Employee ID], Sum(QryOnSite.[Visit Duration]) AS [SumOfVisit Duration], QryOnSite.Name, Format$([CallDate],"mmmm yyyy",0,0) AS MoEnd, Format([CallDate],"yyyymm",0,0) as SortMth
FROM QryOnSite
GROUP BY QryOnSite.FirstName, QryOnSite.LastName, QryOnSite.[Employee ID], QryOnSite.Name, Format$([CallDate],"mmmm yyyy",0,0), Format([CallDate],"yyyymm",0,0);

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks Duane. This was really driving me crazy, however simple it may have been. I will hang on to this bit of knowledge and use it in the future as well.

Sorry about the late "thanks" but I was out of town for a few days.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top