stringsql=$@"SELECT * FROM ICSDeliveryNotice WHERE ID in({ids}) AND DNCode NOT IN(SELECT TransCode From ICSInventoryLotDetail) ";
stringsql=$@"SELECT * FROM ICSDeliveryNotice a WHERE ID in({ids}) AND DNCode NOT IN(SELECT TransCode From ICSInventoryLotDetail b where a.Sequence=b.TransSequence) ";
stringsql=$@"SELECT * FROM ICSManufactureReceive WHERE ID in({ids}) AND RCVCode NOT IN(SELECT TransCode From ICSInventoryLotDetail) ";
stringsql=$@"SELECT * FROM ICSManufactureReceive a WHERE ID in({ids}) AND RCVCode NOT IN(SELECT TransCode From ICSInventoryLotDetail b where a.Sequence=b.TransSequence) ";