Hi,

Please can anybody tell me what is wrong with this SQL Statement?

Code:
strsql = "TRANSFORM Max(Availability.Avail) AS MaxOfAvail " & _
        "SELECT StaffMaster.EmpCode, StaffMaster.EmpName, StaffMaster.Discipline, " & _
        "StaffMaster.Designation FROM (StaffMaster LEFT JOIN Availability ON " & _
        "StaffMaster.EmpCode = Availability.EmpCode WHERE (StaffMaster.Designation<>'Project Manager' " & _
        "AND StaffMaster.Designation NOT LIKE 'Head%' AND StaffMaster.Designation NOT LIKE " & _
        "'%Manager%')) LEFT JOIN Designation ON StaffMaster.Discipline = Designation.Discipline " & _
        "GROUP BY StaffMaster.Designation ORDER BY StaffMaster.Discipline, Designation.Priority, " & _
        "StaffMaster.EmpName PIVOT Availability.Month_Year"

Thanks