e13639
23rd July 2003, 13:14
Hi,
I'd like to do a query using group by, but the compiler gives me an error. Does anybody know how to do that?
Example:
select tisfc030.cwoc, sum(tisfc030.qrjc):tot.qrjc, tiitm001.ctyp
from tisfc030, tiitm001
where tisfc030._index1 inrange {tctror.prd, :pdno.f }
and {tctror.prd, :pdno.t }
and tisfc030.cwoc inrange :cwoc.f and :cwoc.t
and tisfc030.item inrange :item.f and :item.t
and tiitm001.ctyp inrange :ctyp.f and :ctyp.t
and tisfc030.item refers to tiitm001
group by tisfc030.cwoc
selectdo
End of example
The compiler problem is that field tiitm001.ctyp is not included in the group by. I am only interested in group by tisfc030.cwoc and select records where tiitm001.ctyp is in range. Any idea?
I'd like to do a query using group by, but the compiler gives me an error. Does anybody know how to do that?
Example:
select tisfc030.cwoc, sum(tisfc030.qrjc):tot.qrjc, tiitm001.ctyp
from tisfc030, tiitm001
where tisfc030._index1 inrange {tctror.prd, :pdno.f }
and {tctror.prd, :pdno.t }
and tisfc030.cwoc inrange :cwoc.f and :cwoc.t
and tisfc030.item inrange :item.f and :item.t
and tiitm001.ctyp inrange :ctyp.f and :ctyp.t
and tisfc030.item refers to tiitm001
group by tisfc030.cwoc
selectdo
End of example
The compiler problem is that field tiitm001.ctyp is not included in the group by. I am only interested in group by tisfc030.cwoc and select records where tiitm001.ctyp is in range. Any idea?