>>Thanks Naomi
>>
>>The Jobheads problem was my placement of the where clause, as replied to Sergey and Agnes.
>>
>>Maybe it does need a cross-tab but I've never done them in SQL and I thought I'd see how I get on here first. I'm getting resu8lts now but each sum is multiplied by 11 for some reasons (there are 12 records in my test set for teh given JobID).
>>
>>Ah, there are 11records with an inv. no. in JobAct for that jobID, ie the ones I'm interested in.
>
>For cross-tabs look in Downloads section here for FastXTab.
It seems to be a flexible cross-tab so it could be better doing it in custom code.
Edward Pikman
Independent Consultant