CoolFactor
Technical User
Hello,
I'm using the following query to produce a report. I want to sort this expression [FirstName] & " " & [LastName] AS Candidate by last name. The result I want to see is for example: If I have these two names Melissa Rean and Alex South, I want my query to show me those names in ascending order by last name like so:
Melissa Rean
Alex South
instead of:
Rean Melissa
South Alex
SELECT [FirstName] & " " & [LastName] AS Candidate, [Party] & "s" AS [Political Party], tbl_Candidates.State, tbl_Candidates.District, tbl_Candidates.Office, [FundType] & "s" AS [Fund Class], [tbl_Candidates Committees].Committee, [tbl_Candidates Funds].Year, Sum(tbl_Ledger.[Contributions/Disbursements]) AS [SumOfContributions/Disbursements]
FROM (tbl_Candidates INNER JOIN [tbl_Candidates Committees] ON tbl_Candidates.CandidateID=[tbl_Candidates Committees].CandidateID) INNER JOIN ([tbl_Candidates Funds] INNER JOIN tbl_Ledger ON [tbl_Candidates Funds].FundID=tbl_Ledger.CandidateFund) ON tbl_Candidates.CandidateID=[tbl_Candidates Funds].CandidateID
GROUP BY [FirstName] & " " & [LastName], [Party] & "s", tbl_Candidates.State, tbl_Candidates.District, tbl_Candidates.Office, [FundType] & "s", [tbl_Candidates Committees].Committee, [tbl_Candidates Funds].Year
ORDER BY [tbl_Candidates Funds].Year;
I'm using the following query to produce a report. I want to sort this expression [FirstName] & " " & [LastName] AS Candidate by last name. The result I want to see is for example: If I have these two names Melissa Rean and Alex South, I want my query to show me those names in ascending order by last name like so:
Melissa Rean
Alex South
instead of:
Rean Melissa
South Alex
SELECT [FirstName] & " " & [LastName] AS Candidate, [Party] & "s" AS [Political Party], tbl_Candidates.State, tbl_Candidates.District, tbl_Candidates.Office, [FundType] & "s" AS [Fund Class], [tbl_Candidates Committees].Committee, [tbl_Candidates Funds].Year, Sum(tbl_Ledger.[Contributions/Disbursements]) AS [SumOfContributions/Disbursements]
FROM (tbl_Candidates INNER JOIN [tbl_Candidates Committees] ON tbl_Candidates.CandidateID=[tbl_Candidates Committees].CandidateID) INNER JOIN ([tbl_Candidates Funds] INNER JOIN tbl_Ledger ON [tbl_Candidates Funds].FundID=tbl_Ledger.CandidateFund) ON tbl_Candidates.CandidateID=[tbl_Candidates Funds].CandidateID
GROUP BY [FirstName] & " " & [LastName], [Party] & "s", tbl_Candidates.State, tbl_Candidates.District, tbl_Candidates.Office, [FundType] & "s", [tbl_Candidates Committees].Committee, [tbl_Candidates Funds].Year
ORDER BY [tbl_Candidates Funds].Year;