Issue OQL count ID - crash course

0
Hi all, I’m following the new crash course and am getting an error in the provided OQL query. The query is provided in lecture 10.2.3:    SELECT Name DepartmentName, COUNT(ID)Number FROM UserManager.Shift2 JOIN UserManager.Shift2_PlanningPeriod/UserManager.PlanningPeriod/UserManager.PlanningPeriod_Department/UserManager.Department LEFT OUTER JOIN UserManager.Shift2_Employee/UserManager.Employee  WHERE ID = NULL GROUP BY Name, ID   The error is: cannot resolve path part ‘ID’.  The idea is to find unused shifts per department, where there is no employee assigned (hence, HAVING E/ID = NULL).      In the course the instruction is to use the expression below but it is not working as well   I don t have big experience in coding, an help would be appreciated :)   Thanks!
asked
4 answers
0

Make ID smallcaps: id

answered
0

Hi Tim,

 

thx for feedback! tried already.. I tried almost everything in order to change that but I get always some error..

Thx for your help!

 

answered
0

Dont know if you are still interested, but try this:

SELECT D.Name DepartmentName, COUNT(S/id) Number
FROM UserManager.Shift S
JOIN S/UserManager.Shift_PlanningPeriod/UserManager.PlanningPeriod/UserManager.PlanningPeriod_Department/UserManager.Department D
LEFT OUTER JOIN S/UserManager.Shift_Employee/UserManager.Employee E
WHERE S/UserManager.Shift_Employee = NULL
GROUP BY D.Name

 

answered
0

The way to troubleshoot this would be to open your Domain Model – and double check the table names, capitalization, spelling mistakes etc… the error you are getting tells you that the field id or ID is not in your Domain Model.

answered