>>I am using SPT to get remote data from two tables.
>>
>>One table(Task Table) has a field called schuledhours. The second table(Assignments Table) is a child of table one with a field called assignedhours. I need a sql that lists the scheduledhours, sum of assignedhours.
>
>
>SELECT TaskTable.*, NVL(Tbl1.SumHours, CAST(0 as int)) AS WholeHours;
>FROM TaskTable;
>LEFT JOIN (SELECT Id, SUM(assignedhours) AS SumHours;
> FROM Assignments;
> GROUP BY Id) Tbl1;
>ON TaskTable.Id = Tbl1.Id
>
>Where Id is the Primary key of TaskTable and FK of Assignments.
Good catch with LEFT JOIN!
If it's not broken, fix it until it is.
My Blog