Hi, I have a query that lists 3 columns:
Name, Amount Paid, Date
I sort by Name first, then by Date (Formatted as "mmm yyyy") but the results do not display the records sorted according to date as I expected.
This is the SQL code:
Code:
SELECT [tblMainStudentInfo].[First Name] & " " & [tblMainStudentInfo].[Last Name] AS Name, tblFeesPaid.AmountPaid, Format([MonthPaid],"mmm yyyy") AS MonthYear
FROM tblMainStudentInfo INNER JOIN tblFeesPaid ON tblMainStudentInfo.PrimaryKey = tblFeesPaid.fkStudentID
ORDER BY [tblMainStudentInfo].[First Name] & " " & [tblMainStudentInfo].[Last Name], Format([MonthPaid],"mmm yyyy");
The results show:
Clare Chang $180.00 Apr 2011
Clare Chang $180.00 Feb 2011
Clare Chang $180.00 Jan 2011
Clare Chang $180.00 Mar 2011
I expected records to be sorted as:
Jan 2011
Feb 2011
Mar 2011
Apr 2011
Anyone knows why? Thanks.