Hi,
I've got a query which runs as follows:
strSQL = "SELECT Users.UserID, Users.FirstName, Users.Surname, Users.FeeEarner, Users.Partner, " &_
"StaffStatus.StartDate, StaffStatus.LeavingDate, " &_
"(SELECT Entitlement FROM HolidayEntitlement WHERE HolidayEntitlement.UserID=Users.UserID AND EntitlementYear=2006) AS LastYearEntitlement, " &_
"(SELECT EntitlementID FROM HolidayEntitlement WHERE HolidayEntitlement.UserID=Users.UserID AND EntitlementYear=2006) AS LastYearEntitlementID, " &_
"(SELECT Entitlement FROM HolidayEntitlement WHERE HolidayEntitlement.UserID=Users.UserID AND EntitlementYear=2007) AS ThisYearEntitlement, " &_
"(SELECT EntitlementID FROM HolidayEntitlement WHERE HolidayEntitlement.UserID=Users.UserID AND EntitlementYear=2007) AS ThisYearEntitlementID " &_
"FROM Users LEFT JOIN StaffStatus ON Users.UserID = StaffStatus.UserID " &_
"ORDER BY Users.FirstName"
This produces a recordset that shows their name, start date and leaving date and how much holiday they were allowed to take in 2006 and 2007. In my HolidayEntitlement table there is a field called 'Notes' which I have made a memo field. When I try and include this in the query however it gives the error
Invalid Memo, OLE, or Hyperlink Object in subquery 'Notes'
Where am I going wrong?
Thanks very much
Ed
I've got a query which runs as follows:
strSQL = "SELECT Users.UserID, Users.FirstName, Users.Surname, Users.FeeEarner, Users.Partner, " &_
"StaffStatus.StartDate, StaffStatus.LeavingDate, " &_
"(SELECT Entitlement FROM HolidayEntitlement WHERE HolidayEntitlement.UserID=Users.UserID AND EntitlementYear=2006) AS LastYearEntitlement, " &_
"(SELECT EntitlementID FROM HolidayEntitlement WHERE HolidayEntitlement.UserID=Users.UserID AND EntitlementYear=2006) AS LastYearEntitlementID, " &_
"(SELECT Entitlement FROM HolidayEntitlement WHERE HolidayEntitlement.UserID=Users.UserID AND EntitlementYear=2007) AS ThisYearEntitlement, " &_
"(SELECT EntitlementID FROM HolidayEntitlement WHERE HolidayEntitlement.UserID=Users.UserID AND EntitlementYear=2007) AS ThisYearEntitlementID " &_
"FROM Users LEFT JOIN StaffStatus ON Users.UserID = StaffStatus.UserID " &_
"ORDER BY Users.FirstName"
This produces a recordset that shows their name, start date and leaving date and how much holiday they were allowed to take in 2006 and 2007. In my HolidayEntitlement table there is a field called 'Notes' which I have made a memo field. When I try and include this in the query however it gives the error
Invalid Memo, OLE, or Hyperlink Object in subquery 'Notes'
Where am I going wrong?
Thanks very much
Ed