1 2 3 4 5 6 7 8
| rsRecords_achat.Open "select b.reference, b.designation, b.id_besoin, (b.qte_total_besoin - nvl(tmp.total,0) - nvl(b.qte_tot_reserve,0)) as tot_besoin from toperp.t_besoin b " _
& " inner join t_article a on b.id_article = a.id_article inner join topmes.wo_material wm on wm.id_wo_material = b.id_besoin_org inner join topmes.wo w " _
& " on wm.id_wo = w.id_wo left outer join (select bi.id_besoin, sum(bi.qte_tot_reserve) As total from toperp.t_besoin_stock_in bi group by bi.id_besoin) tmp on b.id_besoin = tmp.id_besoin " _
& " where b.id_besoin_org = " & rsRecord_res.Fields("id_wo_instruction").Value, conn, adOpenForwardOnly, adLockReadOnly
If conn.State = adStateOpen Then
If Not rsRecords_achat.EOF Then |
Partager