How can i use the END_DATE/START_DATE from the first sub select in the second subselect?, the provided values are only examples. (06/01/2010).
SELECT "PROJECT"."ID",
"PROJECT"."CLIENT",
"PROJECT"."NAME",
"PROJECT"."STATE",
"PROJECT"."EARLIEST_START",
"PROJECT"."LATEST_END",
"PROJECT"."EFFORT",
"PROJECT"."LINK",
"PROJECT"."STATUS",
"PROJECT"."DESCRIPTION",
(SELECT SUM((END_DATE - START_DATE + 1) * (WORKLOAD / 100))
FROM WORKITEM WHERE PROJECT = PROJECT.ID
) AS "P_A",
(SELECT COUNT(*)
FROM PUBLIC_HOLIDAY
WHERE HOLIDAY_DATE BETWEEN TO_DATE('06/1/2010','MM/DD/YYYY') AND
TO_DATE('06/2/2010','MM/DD/YYYY')) AS P_B,
"PROJECT_STATE"."STATE",
"PERSON"."DISPLAY_NAME" AS "RESPONSIBLE"
FROM "PROJECT"
INNER JOIN "PROJECT_STATE" ON PROJECT.STATE = PROJECT_STATE.ID
INNER JOIN "PERSON" ON RESPONSIBLE = PERSON.ID
WHERE (PROJECT.CLIENT = '1') AND (PROJECT.STATE = 1)
ORDER BY "PROJECT"."NAME" ASC