ORDER BY需要在SQL SELECT语句中按姓氏排序

时间:2016-11-24 17:00:43

标签: vba access

SQLHonorary = "SELECT TblMembers.LastName, TblMembers.FirstName, TblMembers.Status, [FirstName] & "" "" & [LastName] AS FullName " & _
    "FROM TblMembers " & _
    "WHERE (((TblMembers.Status) = 'Honorary')) " & _
    "ORDER BY ((TblMembers.LastName); ACS )"

我正在尝试按姓氏排序,但是收到错误,我不知道如何格式化最后一行。错误3075语法错误,无论我做什么组合,我都会遇到各种错误。

似乎无法在线找到帮助.....

谢谢,

1 个答案:

答案 0 :(得分:0)

SQLHonorary - 'SELECT LastName, FirstName, Status, ' & _
    'CONCAT(FirstName, " ", LastName) AS FullName FROM TblMembers ' & _
    'WHERE Status = "Honorary" ORDER BY LastName'