>Here is my SPT
>
>testString = "Select webprddt6.resmngt3.recseq, task, hours2, SUM(ahours) As ah From webprddt6.resmngt2" +;
>" Join webprddt6.resmngt3 On webprddt6.resmngt3.projindex = webprddt6.resmngt2.recseq" +;
>" Join webprddt6.resmngt3b On webprddt6.resmngt3b.taskindex = webprddt6.resmngt3.recseq" +;
>" Where status = 1 And projected = 0 And deptno = '660' Group By webprddt6.resmngt3.recseq, task, hours2"
>
>Would like to show only records where ah is lesthan hours2.
You just need to add having clause at the end of your statement
text to lcText noshow
Select webprddt6.resmngt3.recseq, task, hours2, SUM(ahours) As ah From webprddt6.resmngt2 ;
Join webprddt6.resmngt3 On webprddt6.resmngt3.projindex = webprddt6.resmngt2.recseq ;
Join webprddt6.resmngt3b On webprddt6.resmngt3b.taskindex = webprddt6.resmngt3.recseq ;
Where status = 1 And projected = 0 And deptno = '660' ;
Group By webprddt6.resmngt3.recseq, task, hours2 ;
having sum(aHours) <2
endtext
If it's not broken, fix it until it is.
My Blog