dharkangel
MIS
Hello,
I have to select multiple fields to get the sum and although the following example works great for selecting one field, I need to be able to select multiples. I tried the code below and I get an syntax error.
SELECT (SELECT Sum(ProgramManagementWeeklyClosedByCommit AS PMCBC, ProgramManagementWeeklyTotalClosed AS PMTotal)) FROM QPTClosedByCommitByComponent Where ID<=A.ID AND ID>0 AND ID <6), A.ID
FROM QPTClosedByCommitByComponent AS a
WHERE ID>0 And ID<6
ORDER BY ID;
this doesn't work either:
SELECT (SELECT Sum(ProgramManagementWeeklyClosedByCommit, ProgramManagementWeeklyTotalClosed)) FROM QPTClosedByCommitByComponent Where ID<=A.ID AND ID>0 AND ID <6) AS PMMgtCBC, PMTotal, A.ID
FROM QPTClosedByCommitByComponent AS a
WHERE ID>0 And ID<6
ORDER BY ID;
thank you,
sal
I have to select multiple fields to get the sum and although the following example works great for selecting one field, I need to be able to select multiples. I tried the code below and I get an syntax error.
SELECT (SELECT Sum(ProgramManagementWeeklyClosedByCommit AS PMCBC, ProgramManagementWeeklyTotalClosed AS PMTotal)) FROM QPTClosedByCommitByComponent Where ID<=A.ID AND ID>0 AND ID <6), A.ID
FROM QPTClosedByCommitByComponent AS a
WHERE ID>0 And ID<6
ORDER BY ID;
this doesn't work either:
SELECT (SELECT Sum(ProgramManagementWeeklyClosedByCommit, ProgramManagementWeeklyTotalClosed)) FROM QPTClosedByCommitByComponent Where ID<=A.ID AND ID>0 AND ID <6) AS PMMgtCBC, PMTotal, A.ID
FROM QPTClosedByCommitByComponent AS a
WHERE ID>0 And ID<6
ORDER BY ID;
thank you,
sal