|
Read table and read again with Alias
select ticpr300_s.indt:cost.date
from ticpr300 ticpr300_s
where ticpr300_s.item = :tibom010.sitm
and ticpr300_s.indt <= (:hold.old.date + 3600)
| and ticpr300_s.indt >= :tibom010.indt
order by ticpr300_s.indt desc
as set with 1 rows
selectdo
select ticpr300.*
from ticpr300
where ticpr300.item = :tibom010.sitm
and ticpr300.indt = :cost.date
and ticpr300.amnt(1) > 0
order by ticpr300.indt desc
selectdo
if cnt.1 = 0 then
cnt.1 = cnt.1 +1
hold.date = ticpr300.indt
endif
| if hold.date = ticpr300.indt then
if hold.date = ticpr300.indt then
if bom.level(1;1) = "1" then
tot.old.amnt = tot.old.amnt + (ticpr300.amnt(1) * tibom010.qana)
endif
if done.it <> "done.it" then
comp.old.amnt = comp.old.amnt + (ticpr300.amnt(1) * tibom010.qana)
comp.old.date = ticpr300.indt
endif
endif
selectempty
comp.old.date = 0
endselect
done.it = "done.it"
selectempty
comp.old.date = 0
endselect
__________________
Tommy L. Bacon, CPIM
|