jcasanov
9th March 2007, 19:46
Hi,

i'm trying to do a script to delete backorders in batch following some criteria, is this as simple as let tdsls041.bqua = 0 or there are more steps to follow?

I have this SQL to look for backorders for specific items, i want to make another SQL that join with tiitm001 and tdsls040 to also search for tiitm001.csgs and tdsls040.odat, tdsls040.cuno and some other fields.

This sql is based in the query.extension in tdsls4125m000 and the code in tdsls4418m000

sugestions?


select tdsls041.*
from tdsls041
where tdsls041._index8 = { :item }
and tdsls041.bqua <> 0
and tdsls041.opol <> tcittc.make.customized
and tdsls041.cwar = "QP1"
order by tdsls041._index8
selectdo
select tdsls045.*
from tdsls045
where tdsls045._index1 = { :tdsls041.orno, :tdsls041.pono }
and (tdsls045.bqua <> 0 or tdsls045.srnb <> 0)
and tdsls045.pono <> 0
and tdsls045.cwar = "QP1"
order by tdsls045._index1 desc
as set with 1 rows
selectdo
cant = cant + tdsls041.bqua
endselect
endselect