I’m trying to append an existing named query that pulls from a MS SQL database table. They have a different number of rows and columns, the correlation is first dataset has a list of categories, and second set has hours logged information for those categories (not all). These SELECT statements work separately, but not together. I’m not sure what I’m missing here… thanks.
LEFT JOIN Scope_Categories ON Scope_Categories.Category = Eng_TimeLog.Project_Category
WHERE Scope_Categories.Num =:Num)
DISTINCT Eng_TimeLog.Project_Category AS Category
,SUM(Eng_TimeLog.Hours) AS Hours_Logged
RIGHT JOIN Scope_Categories ON Scope_Categories.Category = Eng_TimeLog.Project_Category
WHERE Eng_TimeLog.Project_Number = :Num AND Eng_TimeLog.Engineer_Name = :Name
GROUP BY Project_Category)