smusba
5th September 2011, 14:28
how to write the index


select tdsls041.*,tiitm001.*
from tdsls041,tiitm001
where tdsls041._index2 inrange {" ",:item.f," "," ",:cuno.f} and {" ",:item.t," "," ",:cuno.t}
|and tdsls041._index2 inrange {:item.f} and {:item.t}
and tdsls041.odat between :ddat.f and :ddat.t
and tiitm001._index1 refers to tdsls041
order by tdsls041._index1
The above index is giving error

bdittmar
5th September 2011, 15:05
how to write the index


select tdsls041.*,tiitm001.*
from tdsls041,tiitm001
where tdsls041._index2 inrange {" ",:item.f," "," ",:cuno.f} and {" ",:item.t," "," ",:cuno.t}
|and tdsls041._index2 inrange {:item.f} and {:item.t}
and tdsls041.odat between :ddat.f and :ddat.t
and tiitm001._index1 refers to tdsls041
order by tdsls041._index1
The above index is giving error

Hello,
tdsls041._index2 is cprj, item, cntr, ddta, cuno, orno, pono

I suppose the problem in your query is the date-field (Planned delivery date (tdsls041.ddta)).
Use a :ddta.f and :ddta.t in your where condition.

If you use PCF :

"" to "ZZZZZZ" for cprj

"" to "ZZZ" for cntr

So your query should be like :

where tdsls041._index2 inrange {"",:item.f,"",:ddta.f,:cuno.f}
and {"ZZZZZZ",:item.t,"ZZZ",:ddta.t,:cuno.t}

Regards

zardoz
5th September 2011, 15:05
tiitm001._index1 refers to tdsls041 is incorrect (tdsls041 index 1 is order number, not item)

substitute with:

tdsls041.item refers to tiitm001